README
northwind-back-end
A local REST API for Northwind data, containing:
- Products including images
- Employees including images
- Categories including images
- Contact Us
- Register
- Login
Installation:
npm i -g northwind-back-end
(You must install it globally using the -g flag so the backend could be started via cli command)
CLI Commands:
- Run the REST API:
northwind
- Display help:
northwind --help
- Display version:
northwind --version
The API
Products:
GEThttp://localhost:3030/api/products→ get all productsGEThttp://localhost:3030/api/products/delayed→ get all products with a 3sec delayGEThttp://localhost:3030/api/products/7→ get product #7GEThttp://localhost:3030/api/products/delayed/7→ get product #7 with a 3sec delayPOSThttp://localhost:3030/api/products→ add a new productPUThttp://localhost:3030/api/products/7→ update product #7DELETEhttp://localhost:3030/api/products/7→ delete product #7GEThttp://localhost:3030/api/products/images/7.jpg→ get product #7's image
Employees:
GEThttp://localhost:3030/api/employees→ get all employeesGEThttp://localhost:3030/api/employees/7→ get employee #7POSThttp://localhost:3030/api/employees→ add a new employeePUThttp://localhost:3030/api/employees/7→ update employee #7DELETEhttp://localhost:3030/api/employees/7→ delete employee #7GEThttp://localhost:3030/api/employees/images/7.jpg→ get employee #7's image
Categories:
GEThttp://localhost:3030/api/categories→ get all categoriesGEThttp://localhost:3030/api/categories/7→ get category #7POSThttp://localhost:3030/api/categories→ add a new categoryPUThttp://localhost:3030/api/categories/7→ update category #7DELETEhttp://localhost:3030/api/categories/7→ delete category #7GEThttp://localhost:3030/api/categories/images/7.jpg→ get category #7's image- Note: for using the categories you must register or logged-in.
Contact Us:
GEThttp://localhost:3030/api/contact-us→ get all contact-us messagesPOSThttp://localhost:3030/api/contact-us→ add a new contact-us message
Auth:
POSThttp://localhost:3030/api/auth/register→ register as a new userPOSThttp://localhost:3030/api/auth/login→ login as an existing user