Welcome to the API documentation for your project. This guide provides details about available endpoints, their functionalities, parameters, and responses.
- Endpoint:
/categories
- Method:
GET
- Summary: Retrieve a list of all categories.
- Responses:
200 OK
: Successful response
- Endpoint:
/categories
- Method:
POST
- Summary: Create a new category.
- Parameters:
category
(body): Category data to be created
- Responses:
201 Created
: Category created successfully404 Not Found
: Admin not found or unauthorized
- Endpoint:
/products
- Method:
GET
- Summary: Fetch a list of all products.
- Responses:
200 OK
: Successful response
- Endpoint:
/products
- Method:
POST
- Summary: Add a new product.
- Parameters:
product
(body): Product data to be created
- Responses:
201 Created
: Product created successfully404 Not Found
: Admin not found or unauthorized
- Type: Object
- Properties:
name
(string): Name of the categoryemail
(string): Admin's emailpassword
(string): Admin's password
GET /categories
{
"1": {
"name": "Fruit",
"image": "http://127.0.0.1:5000/static/assets/categories/fruit.jpg"
},
"2": {
"name": "Vegetable",
"image": "http://127.0.0.1:5000/static/assets/categories/vegetable.jpg"
},
}