Create a simple REST API using Node.js + TypeScript + Express that lets users manage a TODO list.
-
Add a new TODO
POST /todos- Body:
{ "task": "string" }
-
Get all TODOs
GET /todos
-
Mark a TODO as done
PUT /todos/:id
-
Delete a TODO
DELETE /todos/:id
- Store TODOs in memory (array or object).
- Use TypeScript interfaces for your TODO structure.
- Use only basic libraries (e.g., Express).
- Add filtering support (e.g.,
GET /todos?done=true) - Add validation (task should not be empty)
- Handle error responses gracefully
npm install
npm run devThe server will run at http://localhost:3000
Please zip the entire project folder and send it back when done.