Skip to content

Basic API with CRUD operations, and importing a CSV file with Stream

Notifications You must be signed in to change notification settings

gcrozariol/tasks-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rocketseat's Ignite Node.js Module // Project #01

πŸš€ Main Challenge

This challenge is about creating an API to manipulate a local JSON file (as if it were a database) through CRUD operations using Node.js' native functionalities.

Run the following command to start the project:

npm run dev

Now, with the server running locally using the port 3333, we are ready to make some requests.

πŸ§ͺ Testing the Main Challenge

You can test this challenge by make requests to this server. You can use Insomina or Postman – or whatever you prefer, really.

Here are the current available routes for this application:

  • Create a task
    • Method    β†’  POST
    • Endpoint  β†’  http://localhost:3333/tasks
    • Body request must contain both name and description parameters.

  • Get list of tasks
    • Method    β†’  GET
    • Endpoint  β†’  http://localhost:3333/tasks
    • You can also filter the results by name/description by querying it with the key search.

  • Update a task
    • Method    β†’  PUT
    • Endpoint  β†’  http://localhost:3333/tasks/:id
    • Body request must contain either the name or the description parameter – or both.


πŸš€ Extra Challenge

To run this extra challenge, we need to make sure our server above is up and running.

We also need to install one dependency. To install it, run:

npm i

πŸ§ͺ Testing the Extra Challenge

Execute the code the following command:

npm run import:csv

By running this command, we should be able to import the records within the CSV file located inside the src/files directory.

About

Basic API with CRUD operations, and importing a CSV file with Stream

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published