Skip to content

Node.js with Streams, a Rest API using the HTTP native module and a simple local Database with JSON

License

Notifications You must be signed in to change notification settings

livimonte/node-streams

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project

Node.js with Streams, a Rest API using the HTTP native module and a simple local Database with JSON.

Cover of the project

This project was developed during a @rocketseat course for study purposes.

Tech

Node.js Streams Rest API Middleware HTTP JSON Database Regex

Getting Started

Install dependencies

npm install

Project 1: Fake stream upload

Start the server on port: 3334.

npm run stream-server

With the server up, run the fake stream upload:

npm run stream-upload

Project 2: Rest API with local JSON database

Start the server on port: 3333.

npm run dev

API Routes

GET /users

Retrieves a list of users. You can pass a query parameter search to filter users by their id, name, or email.

  • Query Parameters:

    • search (optional): A string to filter users.
  • Response:

    • 200 OK: Returns an array of user objects.

POST /users

Creates a new user.

  • Request Body:

    • name: Name of the user.
    • email: Email of the user.
  • Response:

    • 201 Created: Returns the created user object.

PUT /users/:id

Updates an existing user.

  • URL Parameters:

    • id: The unique identifier of the user.
  • Request Body:

    • name: New name of the user.
    • email: New email of the user.
  • Response:

    • 204 No Content: Indicates successful update.

DELETE /users/:id

Deletes a user.

  • URL Parameters:

    • id: The unique identifier of the user.
  • Response:

    • 204 No Content: Indicates successful deletion.

Contribute

  • Fork this repository
  • Create a branch with your feature: git checkout -b my-feature
  • Commit your changes: git commit -m 'feat: add my new feature'
  • Push it to your branch: git push origin my-feature

After merging your pull request, your branch can be deleted.

Check the details about the types, verbs and commit messages here CONTRIBUTING.md

Also check the CODE_OF_CONDUCT.md

License

This project is MIT Licensed

About

Node.js with Streams, a Rest API using the HTTP native module and a simple local Database with JSON

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published