- Express
- Typescript
- Yup
- MongoDB
- Mongoose
- Multer
- Cloudinary
- JWT
- Nodemailer
- EJS
https://sanber-be-58-final-project-yusuf-production.up.railway.app/
Base URL
https://sanber-be-58-final-project-yusuf-production.up.railway.app/api
Request Headers
Authorization: Bearer <your-jwt-token>
- Endpoint:
/
- Method:
GET
- Request Body:
- Endpoint:
/auth/register
- Method:
POST
- Request Body:
{
"email": "yusuf.dev.2024@gmail.com",
"fullName": "Yusuf Dev",
"password": "12341234",
"username": "yusuf.dev",
"roles": ["admin"]
}
- Endpoint:
/auth/login
- Method:
POST
- Request Body:
{
"email": "yusuf.dev.2024@gmail.com",
"password": "12341234"
}
- Endpoint:
/auth/me
- Method:
GET
- Request Headers:
Authorization: Bearer <your-jwt-token>
- Endpoint:
/auth/profile
- Method:
PUT
- Request Headers:
Authorization: Bearer <your-jwt-token>
- Request Body:
{
"fullName": "Update Yusuf",
"password": "admin123"
}
- Endpoint:
/products
- Method:
GET
- Endpoint:
/products
- Method:
POST
- Request Body:
{
"name": "Kemeja dengan Kategori",
"description": "Deskripsi kemeja dengan kategori",
"images": ["https://res.cloudinary.com/five-code/image/upload/v1718805645/fxuurm45mt5talry7a29.png", "sepatu2.jpg", "sepatu3.jpg"],
"price": 15000,
"qty": 100,
"category": "66a260cd6ceb26325b62fcef"
}
- Endpoint:
/products/:id
- Method:
GET
- URL Parameters:
id
(required): The ID of the product.
- Endpoint:
/products/:id
- Method:
PUT
- URL Parameters:
id
(required): The ID of the product.
- Request Body:
{
"name": "Update"
}
- Endpoint:
/products/:id
- Method:
DELETE
- URL Parameters:
id
(required): The ID of the product.
- Endpoint:
/categories
- Method:
GET
- Endpoint:
/categories
- Method:
POST
- Request Body:
{
"name": "Test"
}
- Endpoint:
/categories/:id
- Method:
GET
- URL Parameters:
id
(required)
- Endpoint:
/categories/:id
- Method:
PUT
- URL Parameters:
id
(required)
- Request Body:
{
"name": "update"
}
- Endpoint:
/categories/:id
- Method:
DELETE
- URL Parameters:
id
(required)
- Endpoint:
/upload
- Method:
POST
- Request Body: Form Data
{
"file": "image.png"
}
- Endpoint:
/uploads
- Method:
POST
- Request Body: Form Data
{
"files": "image1.png",
"files": "image2.png"
}
- Endpoint:
/orders
- Method:
POST
- Request Body:
{
"grandTotal": 289000,
"orderItems": [
{
"productId": "66a89e3fccb68bdd5ff7603b",
"quantity": 1
}
],
"status": "pending"
}
- Endpoint:
/orders
- Method:
GET