Basic REST API in which you can do GET, POST, PACTH and DELETE, testing can be done using Postman, Thunder Client, Insomia or similar testing applications
Follow these steps to correctly configure the project:
- Clone this repository to your local machine.
- npm install to install the necessary dependencies
- npm run dev to raise the server
- npm test to start the test
Get All Brands
URL: /api/brands/api/brands/
Method: GET
Description: Retrieve a list of all brands
Get a Brand
URL: /api/brands/:id
Method: GET
Description: Retrieve a specific brand
Update Brand
URL: /api/brands/:id/api/brands/:id
Method: PUT
Description: Update a specific brand by ID.
Request Body: JSON object with brand data.
Delete a Brand
URL: /api/brands/:id
Method: DELETE
Description: Delete a specific brand by ID.
Get Products by Brand
URL: /api/brands/:id/products
Method: GET
Description: Retrieve products associated with a specific brand by ID.
Create a Product
URL: /api/products/
Method: POST
Description: Create a new product.
Request Body: JSON object with product data.
Get All Products
URL: /api/products/
Method: GET
Description: Retrieve a list of all products.
Get a Product
URL: /api/products/:id
Method: GET
Description: Retrieve a specific product by ID.
Update a Product
URL: /api/products/:id
Method: PUT
Description: Update a specific product by ID.
Request Body: JSON object with product data.
Delete a Product
URL: /api/products/:id
Method: DELETE
Description: Delete a specific product by ID.
Create a User
URL: /api/users/
Method: POST
Description: Create a new user.
Request Body: JSON object with user data.
Get All Users
URL: /api/users/
Method: GET
Description: Retrieve a list of all users.
Get a User
URL: /api/users/:id
Method: GET
Description: Retrieve a specific user by ID.
Update a User
URL: /api/users/:id
Method: PUT
Description: Update a specific user by ID.
Request Body: JSON object with user data.
Delete a User
URL: /api/users/:id
Method: DELETE
Description: Delete a specific user by ID.
Get Products by User
URL: /api/users/:id/products
Method: GET
Description: Retrieve products associated with a specific user by ID.