Skip to content

Latest commit

 

History

History
44 lines (28 loc) · 1002 Bytes

README.md

File metadata and controls

44 lines (28 loc) · 1002 Bytes

Snack Store api

Little api to manage a snacks inventory

How to run

docker and docker-compose are needed to get the enviroment up and running

To start the application just run the following command in a terminal within the project directory

$ docker-compose up

Sequelize will create the corresponding tables to match models and the api will be available at http://localhost:3000

Seed data

In a second terminal enter app container and run command to seed

docker-compose exec --user node web sh
$ ./node_modules/.bin/sequelize db:seed:all

Access database commandline

In a different terminal enter to database container

$ docker-compose exec postgres sh

Once inside just use psql

$ PGPASSWORD=secretsnacks psql -U applaudo -d snacks

Databse schema

Alt text