This is the first challenge of node.js of the Ignite Course from Rocketseat.
It consists in a simple API that manages tasks (Create, Register, Update and Delete). Also, there's a functionality that imports tasks from a CSV file. The API is made with pure node.js, not using any frameworks, with the aim of learning the basics and some things that frameworks do behind the scenes.
If you want to test the API, you can follow these steps:
- Clone the repository
- Run
npm i
to install the csv-parser - Run
npm run dev
to start the server
The structure of a Task in the database is as it follows:
id
- Unique identifier for each task.title
- Title of the task.description
- Description of the task.completed_at
- Date the task was completed. The initial value isnull
.created_at
- Date the task was created.updated_at
- Date the task was updated.
POST - /tasks
Route to create a task. Send the fields `title` and `description` in the body of the request as a json.`GET - /tasks`
Route to list all the tasks in the database.`PUT - /tasks/:id`
Route to update a task by id. In the body of the request, send the field `title` and/or `description`. Also, send the id as a route parameter.DELETE - /tasks/:id
Route to delete a task by id.`PATCH - /tasks/:id/complete`
Route to mark a task as complete.To import tasks via csv, run node src/import_CSV/import.js
in the route directory.