Skip to content

An API that manages tasks (Create, Register, Update and Delete). This is the first challenge of node.js of the Ignite Course from Rocketseat

Notifications You must be signed in to change notification settings

thainapires/task-api-crud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📝 Tasks API

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.

📌 Usage

If you want to test the API, you can follow these steps:

  1. Clone the repository
  2. Run npm i to install the csv-parser
  3. Run npm run dev to start the server

📌 Tasks fields and Routes

📂 Fields

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 is null.
  • created_at - Date the task was created.
  • updated_at - Date the task was updated.

🔗 Routes:

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.

📥 Import tasks via csv

To import tasks via csv, run node src/import_CSV/import.js in the route directory.

About

An API that manages tasks (Create, Register, Update and Delete). This is the first challenge of node.js of the Ignite Course from Rocketseat

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published