Clone the repository:
https://github.com/sulavpradhan/todo-app-api.git
Enter the project directory and install all the dependencies using npm or yarn. npm i or yarn
Set the environment variables. Use the .env.example file as a refrence for creating the env file.
Use the command yarn start or npm start to start the server.
Go to url http://localhost:3030/api/v1/todo/get-todo
to see the website.
Request type: GET
Route: /todo/get-todo
This API renders a page that shows all the todos.
Request type: GET
Route:/todo/get-done-todo
This API renders a page that shows all the todos that have been completed.
Request type: GET
Route:/todo/get-upcomming-todo
This API renders a page that shows all the todos of the future.
Request type: POST
Route: /todo/create-todo
This API allows the user to save new todos.
The body of the request must contain all the data regarding the todo. It should look something like this.
{name:"todo name",desription:"todo description",date:"2023-11-11T20:20"}
The date must be greater than the current date.
Request type: POST
Route: /todo/update-todo
This API allows the user to make changes to existing todos.
The id of the todo to be edited must be in the query parameters of the request as _id.
{_id:"todo id"}
The updates to the todo must be in the body of the request. Let us consider that you want to change the name of the todo then the body will look something like this:
{name:"new name"}
Request type: POST
Route: /todo/delete-todo/:id
This API allows the user to delete existing todos.