- Express.js + mongodb API
- Uses official Mongo image
- No database schema
- CRUD operations
- HTTP methods: GET, POST, PUT, PATCH, DELETE
- Resources:
-- Products
-- Categories - URLS:
-- GET/POST/PUT/PATCH/DELETE /products
-- GET/POST/PUT/PATCH/DELETE /categories
-- GET/PUT/PATCH/DELETE /products/:id
-- GET/PUT/PATCH/DELETE /categories/:id
-- GET/PUT/PATCH/DELETE /categories/:id/products
-- GET /categories/:id?expand=products - uses PORT 80
cd [inside cloned git repo directory]
then
docker-compose up
OR run in detached (background) mode
docker-compose up -d
Once the container is launced, open browser or API management platform like Postman and enter
localhost:/80/[resource]
eg:
localhost:80/products
localhost:80/categories/dairy/products
if in detached mode
docker-compose down
otherwise use CTRL + C in command window