This repository demonstrates the usage of Sequelize within an Express application. The implemented app is a simple beer registration tool.
npm install
node_modules/.bin/sequelize db:migrate
npm start
By running these commands you will start the application and create an SQLite database in your app dir. Just open http://localhost:4000.
docker build --tag express-server .
docker run --name express-server --rm -p 4000:4000 -d express-server
Tests are most implemented with Mocha. But there is also a little bit of Supertest and Chai as well.
You can run all tests by npm test
The app is based on three different environments: dev, test, and production.
For dev and test environments, the app will use an SQLite database, which as mentioned before, will be created in your app dir (it's just a binary file that can be deleted and replaced any time).
Also, the app will generate a different SQLite database depending on the environment you are on (dev or test), so you can run your tests with confidence, knowing that your dev database will keep untouched.
For production, there is some database environment variables you can set to configure your own instance.