Accompanying repository for grocery auth with JWTs and node
STEPS
-
Download zip folder in your computer then run commnad npm install
-
Install mongoDB in your computer
API Routes
-
Url : http://localhost:3000/api/v1/users/register - POST
Request body
name,password,email,gender,phonenumber,role
Register one user as admin
-
Url : http://localhost:3000/api/v1/login - POST
Request body
name,password
-
Url : http://localhost:3000/api/v1/products - POST
This route access only admin
Login with admin and get token
Request body
Header : Authorization : Bearer [ADMIN TOKEN HERE]
Enter product data in csv file. csv file located in csv folder
-
Url : http://localhost:3000/api/v1/products/review - POST
This route access only client
Login with client and get token
Request body
Header : Authorization : Bearer [CLIENT TOKEN HERE]
userId,barcode,review_content
-
Url : http://localhost:3000/api/v1/products/search - POST
Request body
searchText : Product name