API | Routes - adrianrdguez/BRVending-Back GitHub Wiki
API ROUTES
Please note that all routes in this API should be called with the /api
prefix before the endpoint:
POST http://localhost:3000/api/auth/signup
AUTHENTICATION ENDPOINTS
METHOD |
URL |
What does it do |
PARAMS |
RETURNS |
POST |
auth/signup |
Create a new account |
name , email , password |
name , email , token |
POST |
auth/login |
Authenticates a user |
email , password |
name , email , token |
CLIENTS ENDPOINTS
METHOD |
URL |
What does it do |
GET |
me/clients |
Get All Clients |
GET |
me/clients/:clientId |
Get One Client |
POST |
me/clients |
Create One Client |
PUT |
me/clients/:clientId |
Update Client |
DELETE |
me/clients/:clientId |
Delete Client |
CLIENT ORDERS ENDPOINTS
METHOD |
URL |
What does it do |
GET |
me/clients/:clientId/orders |
Get All Client's Orders |
GET |
me/clients/:clientId/orders/:orderId |
Get One Client's Order |
ORDER ENDPOINTS
METHOD |
URL |
What does it do |
GET |
me/orders |
Get All Orders |
GET |
me/orders/:orderId |
Get One Order |
POST |
me/orders |
Create One Order |
PUT |
me/orders/:orderId |
Update Order |
DELETE |
me/orders/:orderId |
Delete Order |
PRODUCT CATEGORIES ENDPOINTS
METHOD |
URL |
What does it do |
GET |
me/products/categories |
Get All Products Categories |
POST |
me/products/categories |
Create One Products Category |
DELETE |
me/products/categories/:categoryId |
Delete One Products Category |
PUT |
me/products/categories/:categoryId |
Update One Products Category |
PRODUCTS ENDPOINTS
METHOD |
URL |
What does it do |
GET |
me/products |
Get All My Products |
GET |
me/products/:productId |
Get One Product |
POST |
me/products |
Create One Product |
DELETE |
me/products/:productId |
Delete Product |
PUT |
me/products/:productId |
Update Product |