The Task Manager API is a solution for managing tasks using Node.js and the csv-parser library. It simplifies the process of task creation, retrieval, updating, and deletion while also providing the ability to import tasks from CSV files.
-
Create Task (POST /tasks): Create new tasks by sending
title
anddescription
in the request body. Theid
,created_at
,updated_at
, andcompleted_at
fields are automatically generated. -
List Tasks (GET /tasks): Retrieve a list of all tasks or perform searches based on
title
anddescription
. -
Update Task (PUT /tasks/:id): Update task details by
id
. Sendtitle
and/ordescription
in the request body. -
Delete Task (DELETE /tasks/:id): Delete tasks by
id
. -
Complete Task (PATCH /tasks/:id/complete): Mark tasks as complete or not complete.
-
CSV Import: Import tasks from CSV files asynchronously using the csv-parser library.
- Clone this repository.
- Install the required dependencies with
npm install
. - Start the API with
npm run dev
.
-
Request:
POST /tasks { "title": "Task Title", "description": "Task Description" }
-
Response (201 Created):
-
Request:
GET /tasks
-
Response (200 OK):
[ { "id": "12345", "title": "Task 1", "description": "Description 1", "created_at": "2023-09-08T12:00:00Z", "updated_at": "2023-09-08T12:00:00Z", "completed_at": null }, { "id": "67890", "title": "Task 2", "description": "Description 2", "created_at": "2023-09-08T13:00:00Z", "updated_at": "2023-09-08T13:00:00Z", "completed_at": null } ]
-
Request:
PUT /tasks/12345 { "title": "Updated Title" }
-
Response (204 No Content):
-
Request:
DELETE /tasks/12345
-
Response (204 No Content)
-
Request:
PATCH /tasks/12345
-
Response (204 No Content):
Made with 💜 by Gustavo Fadel.