This is a small project to demonstrate basic knowledge of Node.JS. In it we created a small To Do list API.
In this project we use the node's Express Server. To help refresh the server, Nodemon is also used as a developer dependency
To run the project, download or copy the repository with the command:
git clone https://github.com/thalesmacena/Todo-List-API.git
after that, open the terminal in the folder where you copied the files, and use a package manager to start the program script
npm run dev
yarn run dev
The server will start at port 3000
This is the list of routes found in the index.js file
GET http://localhost:3000/todos
Lists the index of the To Do lists
POST http://localhost:3000/todos
Create a new To Do list
Body Parameter | Type | Description |
---|---|---|
id |
string |
Required. The To Do List ID |
title |
string |
Required. The To Do List Title |
POST http://localhost:3000/todos/:id/tasks
Create a new Task on a To Do List
Route Parameter | Type | Description |
---|---|---|
id |
string |
Required. The To Do List ID |
Body Parameter | Type | Description |
---|---|---|
title |
string |
Required. The title of the Task |
PUT http://localhost:3000/todos/:id
Change the title of a To Do List
Route Parameter | Type | Description |
---|---|---|
id |
string |
Required. The To Do List ID |
Body Parameter | Type | Description |
---|---|---|
title |
string |
Required. The title of the List |
DELETE http://localhost:3000/todos/:id
Delete a To Do List
Route Parameter | Type | Description |
---|---|---|
id |
string |
Required. The To Do List ID |
requisitionCount Counts the number of requests made on the server
checkToDoExists Checks if there is a list with the id entered in the request
This is a file with the requests, you can copy them to your API Client or use the VS Code extension humao.rest-client to send requests directly within the VS Code