Servidor para TP1 de 75.47 - Taller de Desarrollo de Proyectos 2
docker-compose up
The API will listen on localhost:3000
, and reload on any changes to the source.
The API uses Sequelize to connect to its PostgreSQL DB, and changes are handled using Sequelize-CLI. When making changes to the DB schema, follow these steps:
- Create a new migration that contains the changes to be added. (Use
docker-compose exec app ./node_modules/.bin/sequelize migration:generate --name [YOUR_MIGRATION_NAME]
to make sure it's timestamped) - Implement those changes in the Sequelize model.
- Run migration (
docker-compose exec app npm run db:migrate
).
- Run
docker-compose exec app ./node_modules/.bin/sequelize seed:generate --name [YOUR_SEED_NAME]
to generate it. - Implement the seed.
- Run seeds (
docker-compose exec app npm run db:seed:all
)
Make sure that all tests pass and there are no code style errors by running docker-compose exec app npm test
before pushing.