To setup project:
docker-compose up
docker exec parcels_web_1 npx sequelize-cli db:migrate
docker exec parcels_web_1 npx sequelize-cli db:seed:all
To run tests:
docker exec parcels_web_1 npm test
Example REST payloads:
curl http://localhost:3000/parcels
curl --request POST --data '{"CourierId": 1, "height": 2}' --header "Content-Type: application/json" http://localhost:3000/parcels
curl --request DELETE --header "Content-Type: application/json" http://localhost:3000/couriers/1
curl --request PUT --data '{"width": 21, "height": 22}' --header "Content-Type: application/json" http://localhost:3000/parcels/2
Courier:
- name
Parcel:
- width
- height
- length
- CourierId
- /couriers : A courier has many parcels
- /couriers?name=UPS : filter couriers by name
- /parcels : A parcel belong to a courier