It requires the LTS version of node (>= v.18.17.1).
This project has an API to manage your tasks without using a framework for Nodejs. It also allows to import a local csv using a Stream to populate a fake database.
- Create a task
- List all tasks
- Update a task using its
id
- Remove a task using its
id
- Import multiple tasks via a
csv
file
Field | Description |
---|---|
id |
Unique identifier for each task. |
title |
Task title. |
description |
Dtailed description of a task. |
completed_at |
Date of task completion. The initial value must be null. |
created_at |
Date of task creation. |
updated_at |
Date when task is updated. It must be always have the new date for any updates. |
Create Tasks
HTTP Method | Route |
---|---|
POST |
/tasks |
Creates a new task in the database, sending the fields title
and description
via the request body.
After creating a task, the fields id
, created_at
, updated_at
, and completed_at
will be filled automatically
List All Tasks
HTTP Method | Route |
---|---|
GET |
/tasks |
Lists all tasks stored in the database. It can also permorm a search, filtering tasks by title
and description
Update a task
HTTP Method | Route |
---|---|
PUT |
/tasks/:id |
Updates a task using its id
. In the request body
, you will receive title
and/or description
to be updated.
If only title
was received, description
must not change and vice-versa.
Before an update, a validation happens to check if the given id
matches a task stored in the database.
Remove a task
HTTP Method | Route |
---|---|
DELETE |
/tasks/:id |
Remove a task by using its id
.
Before an update, a validation happens to check if the given id
matches a task stored in the database.
Toggle a task as completed/incompleted
HTTP Method | Route |
---|---|
PATCH |
/tasks/:id/complete |
It toggles a task as completed or incompleted. The incompleted is the "normal" state of a task.
Before an update, a validation happens to check if the given id
matches a task stored in the database.