- Express js and MySql API.
- Register and Login as a user
- Access route based on role.
- Get the list of products, and product details, and update and delete a product.
- Get a list of categories, and category details, and update and delete a product.
git clone https://github.com/Michael-Otieno/express-ecom-api/
npm install bcryptjs body-parser cors express express-session jsonwebtoken mysql2 nodemon passport passport-local sequelize
Endpoint |
HTTP Method |
CRUD Method |
Result |
api/auth/signup |
POST |
CREATE |
Register a user |
api/auth/signin |
POST |
POST |
Login a user |
products/ |
GET |
GET |
Get a list of all products |
products/add |
POST |
CREATE |
Add a product |
products/:id |
GET |
GET |
Get product detail |
products/:id |
PUT |
UPDATE |
Update product detail |
products/:id |
DELETE |
DELETE |
Delete product |
categories/ |
GET |
GET |
Get a list of all categories |
categories/add |
POST |
CREATE |
Add a category |
categories/:id |
GET |
GET |
Get category detail |
categories/:id |
PUT |
UPDATE |
Update category detail |
categories/:id |
DELETE |
DELETE |
Delete category |
- Use Postman for testing the Rest API
- Copyright (c) 2019 Michael Otieno