Skip to content
This repository has been archived by the owner on Oct 11, 2022. It is now read-only.

andreas-bergstrom/parcels

Repository files navigation

Parcels

Instructions

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

Models

Courier:

  • name

Parcel:

  • width
  • height
  • length
  • CourierId

Endpoints

  • /couriers : A courier has many parcels
    • /couriers?name=UPS : filter couriers by name
  • /parcels : A parcel belong to a courier

Releases

No releases published

Packages

No packages published