This is a simple TODO RESTful server written in Node. It uses a simple JSON format.
- Node.js
- npm (comes with Node.js)
Open a terminal and run the following command:
npm install
Open a terminal and run the following command:
npm run start
The server will start on port 3000, if it is free. If you want to change the port, see the Configuration section.
Use the API section to know what is available to use on the server.
In order to change the port of the server, you can change the port
variable inside src/index.js
.
Returns a list of tasks.
curl http://localhost:3000/tasks
Returns a task.
curl http://localhost:3000/tasks/{taskId}
Creates a new task.
curl -X POST -H "Content-Type: application/json" -d '{"title":"Buy milk", "description": "A 3.7% one", "completed": "false", "isInProgress": "false" }' http://localhost:3000/tasks
Updates a task.
curl -X PUT -H "Content-Type: application/json" -d '{"title":"Buy tea", "description": "A green one", "completed": "false", "isInProgress": "false" }' http://localhost:3000/tasks/{taskId}
Deletes a task.
curl -X DELETE http://localhost:3000/tasks/{taskId}