An advanced CRUD API for Node JS implementing with MVC pattern and many more standards...
- MongoDB
- Mongoose
- Express JS
- Node JS
- MVC (Model-View-Controller) Pattern
- Schema Validation
- Form Validation
npm i
MONGODB_DEFAULT_DB=
MONGODB_CLUSTER=
MONGODB_USERNAME=
MONGODB_PASSWORD=
npm run dev
https://www.getpostman.com/collections/058c397fd09ae4cf3a9c
- Base URL - https://node-cruds-api.herokuapp.com/
- All Todos - https://node-cruds-api.herokuapp.com/todos
- Single Todos - https://node-cruds-api.herokuapp.com/todos/60fb121b55e09ca6e646e93e
- Post API - https://node-cruds-api.herokuapp.com/todos [Body dataset Read below]
- Put API - https://node-cruds-api.herokuapp.com/todos/60fb121b55e09ca6e646e93e [Body dataset Read below]
- Delete API - https://node-cruds-api.herokuapp.com/todos/60fb121b55e09ca6e646e93e [Body dataset Read below]
- Delete All API - https://node-cruds-api.herokuapp.com/todos [Body dataset Read below]
URL: http://localhost:3000/todos
Method: GET
[
{
"_id": "60fadbf0fb1e9926fb60c07d",
"title": "First todo",
"status": "Done"
},
{
"_id": "60fadfc796dbc5f55f4adbe0",
"title": "Another task",
"status": "Pending"
}
]
Endpoint: http://localhost:3000/todos/60fadbf0fb1e9926fb60c07d
Method: GET
{
"_id": "60fadbf0fb1e9926fb60c07d",
"title": "First todo",
"status": "Done"
}
Endpoint: http://localhost:3000/todos
Method: POST
{
"title": "Demo Todo 1",
"status": "Pending"
}
{
"_id": "60fb0e8bd8cd4f9cb52910a0",
"title": "Demo Todo 1",
"status": "Pending",
"createdAt": "2021-07-23T18:46:35.288Z",
"updatedAt": "2021-07-23T18:46:35.288Z",
"__v": 0
}
Endpoint: http://localhost:3000/todos/60fadbf0fb1e9926fb60c07d
Method: PUT
{
"title": "Demo Todo 1 Updated",
"status": "Done"
}
{
"message": "Todo has been updated successfully !",
"data": {
"_id": "60fadbf0fb1e9926fb60c07d",
"title": "Demo Todo 1 Updated",
"createdAt": "2021-07-23T17:54:04.823Z",
"updatedAt": "2021-07-23T18:54:12.279Z",
"__v": 0,
"status": "Done"
}
}
Endpoint: http://localhost:3000/todos/60fadbf0fb1e9926fb60c07d
Method: DELETE
{
"message": "Todo has been deleted successfully !",
"data": {
"_id": "60fb139e55e09ca6e646e947",
"title": "Test Todo",
"status": "Done",
"createdAt": "2021-07-23T19:08:14.137Z",
"updatedAt": "2021-07-23T19:08:14.137Z",
"__v": 0
}
}
Endpoint: http://localhost:3000/todos
Method: DELETE
{
"message": "7 Todos have been deleted successfully !"
}
- Create Pull-Request to contribute this Todo API
Patreon Link - https://www.patreon.com/maniruzzaman