GEThttp://localhost:3030/api/products → Get all products.
GEThttp://localhost:3030/api/products/7 → Get product with id 7.
POSThttp://localhost:3030/api/products → Add a new product.
PUThttp://localhost:3030/api/products/7 → Update product with id 7.
DELETEhttp://localhost:3030/api/products/7 → Delete product with id 7.
GEThttp://localhost:3030/api/products/images/01a5a6d5-6cc4-4e72-8f5d-e44efd3bc3d7.jpg → Get that product's image.
GEThttp://localhost:3030/api/products/top-three → Get top three products (must be logged-in).
GEThttp://localhost:3030/api/products/out-of-stock → Get out-of-stock products (must be admin).
Employees:
GEThttp://localhost:3030/api/employees → Get all employees.
GEThttp://localhost:3030/api/employees/7 → Get employee with id 7.
POSThttp://localhost:3030/api/employees → Add a new employee.
PUThttp://localhost:3030/api/employees/7 → Update employee with id 7.
DELETEhttp://localhost:3030/api/employees/7 → Delete employee with id 7.
GEThttp://localhost:3030/api/employees/images/01a5f7d1-42e8-4f71-83c4-58e86751b272.jpg → Get that employee's image.
Suppliers:
GEThttp://localhost:3030/api/suppliers → Get all suppliers.
GEThttp://localhost:3030/api/suppliers/7 → Get supplier with id 7.
POSThttp://localhost:3030/api/suppliers → Add a new supplier.
PUThttp://localhost:3030/api/suppliers/7 → Update supplier with id 7.
DELETEhttp://localhost:3030/api/suppliers/7 → Delete supplier with id 7.
GEThttp://localhost:3030/api/suppliers/images/01a57fe7-0f02-45e3-968b-65264020dd46.jpg → Get that supplier's image.
Categories:
GEThttp://localhost:3030/api/categories → Get all categories (must be logged-in).
GEThttp://localhost:3030/api/categories/7 → Get category with id 7 (must be logged-in).
POSThttp://localhost:3030/api/categories → Add a new category (must be logged-in).
PUThttp://localhost:3030/api/categories/7 → Update category with id 7 (must be logged-in).
DELETEhttp://localhost:3030/api/categories/7 → Delete category with id 7 (must be admin).
GEThttp://localhost:3030/api/categories/images/01a1f85a-335e-4797-82b4-4c53d3aacb73.jpg → Get that category's image.
Contact Us:
POSThttp://localhost:3030/api/contact-us → Add a new contact-us message.
GEThttp://localhost:3030/api/contact-us → Get all contact-us messages (must be admin).
Auth:
POSThttp://localhost:3030/api/register → Register as a new user.
POSThttp://localhost:3030/api/login → Login as an existing user.
POSThttp://localhost:3030/api/refresh-token → Get back a new token (must be logged-in).
Slow Server Simulation:
For simulating a slow server you can precede each endpoint (besides image endpoints) with the word "delay".
This will cause a 3 seconds delay for that route.
This can help test how your frontend behaves when performing an http request to a slow server.
Examples:
GEThttp://localhost:3030/api/products → Gets all products without any delay.
GEThttp://localhost:3030/delay/api/products → Gets all products after a 3 seconds delay.
GEThttp://localhost:3030/api/employees/7 → Gets employee with id 7 without any delay.
GEThttp://localhost:3030/delay/api/employees/7 → Gets employee with id 7 after a 3 seconds delay.
POSThttp://localhost:3030/api/suppliers → Adds a new supplier without any delay.
POSThttp://localhost:3030/delay/api/suppliers → Adds a new supplier after a 3 seconds delay.