About • Features • API Routes • How it works • Tech Stack • Author
Tasks API - is the first challenge of the Node.js track of the Ignite course by @Rocketseat
- List tasks
- Search tasks
- Add tasks
- Update tasks
- Delete tasks
- Mark task as completed
- Importing tasks in bulk from a CSV file
- Persist data in local database (JSON file: db.json)
- GET /tasks
- Listing with or without filters of tasks depending on the existence of the query paramter: 'search' and its value
- POST /TASKS
- Task creation in the local database (db.json file), it is necessary: title and description only
- PUT /tasks/:id
- Update task according to the content of the request body, it is necessary: title and description only
- DELETE /tasks/:id
- Delete task according to ID passed as route parameter
- PATCH /tasks/:id/completed
- Mark task as completed
Before you begin, you will need to have the following tools installed on your machine: Git, Node.js. In addition, it is good to have an editor to work with the code like VSCode and a REST client like Insomnia
# Clone this repository
$ git clone https://github.com/Artur-Poffo/01-Tasks-Ignite.git
# Access the project folder cmd/terminal
$ cd 01-Tasks-Ignite
# install the dependencies
$ npm install
# Run the application in development mode
$ npm run dev
# The server will start at port: 3333 - You can now test in Insomnia or another REST client: http://localhost:3333
To load the CSV you must populate the CSV file in the path: ./streams/tasks.csv
or replace it with a ready-made CSV file but with the same name: tasks.csv
and while running the project as described above, run it in the root directory of project: node ./streams/csv-load.js
, this way the content of the CSV will be converted into tasks and saved in the local database, remembering that the format of the content of your CSV file must follow the same pattern as the default file: tasks.csv
The following tools were used in the construction of the project:
- Node.js
- Javascript
- csv-parse
See the file package.json
- Artur Poffo - Developer