Skip to content

deltorosalazar/node-rest-shop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node.js + Express Products & Orders REST API

Instructions

In order to use the project:

  • Clone the repository
git clone https://github.com/deltorosalazar/node-rest-shop.git
  • Install the dependencies
npm install
  • Run the project
npm run start
  • Fix the code using StandardJS rules
npm run start

To take into accuont

  • The server will be running in the port 3002
  • To test the API, use Postman
  • Some routes are protected, so you have to register and log in first:
Endpoint Method Body
http://localhost:3002/users/signup POST { "email": "test@gmail.com", "password": "password" }
http://localhost:3002/users/login POST { "email": "test@gmail.com", "password": "password" }
http://localhost:3002/users/ GET
http://localhost:3002/users/id DELETE
http://localhost:3002/products GET
http://localhost:3002/products/ POST { "name": "Product", "price": "2000", "token": "XXXX" }
http://localhost:3002/products/id DELETE { "token": "XXXX" }
http://localhost:3002/products PUT { "email": "test@gmail.com", "password": "password" }

The bold endpoints need a token that is generated when the user logs in.

About

Node.js + Express REST API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published