A CRUD task api built using native NodeJs
This is a project used for study purposes only • Samir El Hassan
This project was built with the help of the Rocketseat
- csv-parse
npm install
To start the API, run on root folder:
node --watch src/server.js
To execute the upload batch, run on another terminal in root folder while the API is running:
node batch/import-csv-batch.js
- POST /tasks
curl --location --request POST 'http://localhost:3333/tasks' \
--header 'Content-Type: application/json' \
--data-raw '{
"title": "task 1",
"description": "Task description"
}'
- GET /tasks
curl --location --request GET 'http://localhost:3333/tasks'
- PUT /tasks/{task_id}
curl --location -g --request PUT 'http://localhost:3333/tasks/{task_id}' \
--header 'Content-Type: application/json' \
--data-raw '{
"title": "Altered title",
"description": "Task description"
}'
- PATCH /tasks/{task_id}/complete
curl --location --request PATCH 'http://localhost:3333/tasks/{task_id}/complete'