Skip to content

Generic e-commerce rest API project made with Express/Mongoose

Notifications You must be signed in to change notification settings

PedroDousseau/simple-rest-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⭕ Simple REST API ⭕

A simple REST API project 🙂
It manipulates a fake business model with Users, Products and Orders.


Built with   |    API Routes   |    How to start

📍 Built with

  • Express
  • Mongoose

📍 API Routes

Users

Route Method Description
/users POST Create a new user
/users/authenticate POST Authenticate a user (Used for login, it returns a session token)
/users/refresh-token POST Generate a new token

Products

Route Method Description
/products GET List all active products
/products POST Create a new product
/products DELETE Delete a product
/products/:slug GET Return a product by its slug
/products/:id GET Return a product by its id
/products/:id PUT Update a product
/products/tags/:tag PUT Return all products with a given tag

Orders

Route Method Description
/orders GET List all created orders
/orders POST Create a new order

📍 How to start

  1. Add a config.js file at src/ with the following content:
global.SALT_KEY = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'; // Salt key to enhance password security

module.exports = {
  connectiongString: 'xxxxxx', // DB connectiongString
  sendgridKey: 'xxxxxx', // SendGrid key
}
  1. Install the dependencies and start the app
npm install && npm start

About

Generic e-commerce rest API project made with Express/Mongoose

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published