- User APIs, including client and admin, with authenticationa and authorization middleware.
- Product and search APIs.
- Order APIs.
-
Get all users
/user -
Get one user
/user/:username -
Login user
/user/login
Takes JSON body of:
usernameOrEmail: string
password: stringReturns token: string -
Create User
/user
Takes JSON body of minimun:
username: string,
email: string,
password: string,
firstName: string(optional),
lastName: string(optional),Returns user: JSON object -
Update user
/user/:username
REQUIRES Authorization header with bearer token
Takes JSON body of:
updateField:
options = email: string,
firstName: string,
lastName: string
newValue: stringReturns User JSON object -
Delete a User
/user/:username
REQUIRES Authorization header with bearer token
-
Get all orders
/order -
Get one order
/order/:id -
Delete an order
/order/:id -
Get all orders of an user
/user/:username/order -
Get one order of an user
/user/:username/order/:orderId -
Create an order for an user
/user/:username/order
Takes JSON body:
dateTime: DateTime,
totalPrice: int,
items:[{id: int, size: string, qty: int, unitPrice: int}]Returns Order JSON object
-
Get all socks
/sock -
Get single sock
/sock/:id -
Get three top sold socks
/sock/top/picks -
Upload a sock
/sock
Takes JSON body of minimum:
name: string,
price: int,
imageUrl: string
OPtions:
description: string,
category: string,
size_qty: JSONReturns Sock JSON object -
Delete a sock
- Search socks
/sock/search/:keywords
- Get all socks of men
sock/category/men - Get all socks of women
sock/category/women - Get all socks of kids
sock/category/kids - Get all socks of gifts
sock/category/gifts