raw-nodejs-api icon indicating copy to clipboard operation
raw-nodejs-api copied to clipboard

An users NodeJS API without packages libs or frameworks!

Project logo

NodeJS Users API - Without Frameworks And Packages

License


📝 Table of Contents

  • About
  • Getting Started
  • Usage
  • Built Using
  • Authors

🧐 About

Purpose of this project was build a simple users API in a different way we see all time in nodeJS ecosystem, usually using Express, Adonis, Hapi... I used just the native modules of nodeJS and a JSON file as DataBank, that is managed using node fs



🏁 Getting Started


Installing

git clone https://github.com/NathanCotrim/NodeJS-API.git

or - (GitHub CLI)

gh repo clone NathanCotrim/NodeJS-API 

Running

node src/server.js

🎈 Usage


Main API Routes


http://localhost:3000/users

GET | List all users


http://localhost:3000/user/:id

GET | Get user by Id


http://localhost:3000/new/user

POST | Create User

Receives a JSON:

{
  "name": "Tester",
  "email": "[email protected]"
}

http://localhost:3000/update/user/:id

PATCH | Update User

Receives a JSON with new Information:

{
  "name": "TesterUpdated", (?)
  "email": "[email protected]" (?)
}

http://localhost:3000/delete/user/:id

DELETE | Delete User



To request any route without an app use:

curl ${url} -X ${method}

⛏️ Built Using


✍️ Author - Nathan Cotrim - MIT License