Hare i am created simple backend using convex and express. Convex is a Backend Application Platform that keeps you focused on building your product. Convex Functions, Database, File Storage, Scheduling, and Search fit together cohesively, and are accessible from client libraries for your favorite environment. Everything in Convex is live and realtime.publish
Run the following command
npm app.js
ROOT URL: http://localhost:3000
- Endpoint:
/
- Method:
GET
- Description: fetch all items.
- Response:
"message": "Items fetched successfully", "data": [ { "_creationTime": 1710680813867.3306, "_id": "j972ajnekav8bwydghyr65ajex6nf604", "isCompleted": true, "text": "Buy groceries" }, { "_creationTime": 1710680813867.3308, "_id": "j97akr3qgbrsjz7sc33y169wh56netq0", "isCompleted": true, "text": "Go for a swim" }, { "_creationTime": 1710680813867.331, "_id": "j976wc6rd0ajyprs3ghfj6xc7s6nenhg", "isCompleted": false, "text": "Integrate Convex" }, { "_creationTime": 1710686089679.0994, "_id": "j973t9snpe2de9me2gcyxg2hhd6nf5q8", "isCompleted": true, "text": "bijon" }, { "_creationTime": 1710686814687.1716, "_id": "j97d8s2xfskwt5nx4s7s9vw5tx6nfwhm", "isCompleted": true, "text": "a" } ]
} ```
- Endpoint:
/123
- Method:
GET
- Description: Fetch only single data.
- Response:
"message": "Item fetch successfully", "data": [ { "_creationTime": 1710686814687.1716, "_id": "j97d8s2xfskwt5nx4s7s9vw5tx6nfwhm", "isCompleted": true, "text": "a" } ]
} ```
- Endpoint:
/create
- Method:
POST
- Description: create new data in database
- Body:
"text":"created new data",
"isCompleted":true
} ```
<br>