Node-based REST API that has CRUD methods to create, read, update and delete a set of products.
Uses a SQLite database for development/testing, and PostgreSQL for production.
Clone the project
git clone https://github.com/thatrussguy/mission-labs-tech-test.git
Install dependencies
npm install
Run tests
npm test
Set up database
npm run migrate-latest
Seed database
npm run seed
Start the app locally
npm run start
The app should now running on http://localhost:9090
The following endpoints are available
GET /products
- an array of product objects, each of which has the following properties:
category
name
price
product_id
sizes
priceFrom
, which filters the products by minimum pricepriceTo
, which filters the products by maximum price
POST /products
- an object with the following properties:
category
name
price
sizes
- the posted product
GET /products/:product_id
- a product object, which has the following properties:
category
name
price
product_id
sizes
PATCH /products/:product_id
-
an object with any of the following properties:
category
name
price
sizes
- the updated product
DELETE /products/:product_id
- delete product
product_id
- status 204 and no content