A very simple prototype file based database REST API developed using Nodejs
, ExpressJS
, its easy to use to any type of project
- Dont wait for BE you can use till BE is ready
- Learn CRUD operations without having API dependencies
- No real database required
- Build Prototype based apps and more
Thats it.
It can be accessible here : http://localhost:3030/todos
* Feel free to change port
Feel free to use VSCode REST Client
extension docs are already available in docs/API.rest
file
GET: http://localhost:3030/todos
{
"todos": [
{
"id": "eBPNbH6TOc40qu6DWcRv",
"todo": "Visit office space",
"isCompleted": true,
"created_at": "2022-12-07T19:10:39.106Z"
}
],
"message": "Todo fetched successfully!"
}
POST http://localhost:3030/todo
Content-Type: {{contentType}}
{
"todo": "New todo item",
"isCompleted": true
}
Response
{
"todos": [
{
"id": "eBPNbH6TOc40qu6DWcRv",
"todo": "New todo item",
"isCompleted": true,
"created_at": "2022-12-07T19:10:39.106Z"
}
],
"message": "Todo fetched successfully!"
}
DELETE http://localhost:3030/todo/{id}
Content-Type: {{contentType}}
Response (OK)
{
"message": "Deleted Successfully!"
}
Response (Not exist)
{
"message": "Data doesn't exist or please check the id"
}
All database files should be under src/data/
folder
Example database for Todo
src/data/data.json