This repository demonstrates the usage of Sequelize within an Express application. The implemented app is a simple beer registration tool.
npm install
npm run 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.
Tests are implemented with Jest and Supertest.
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.