This is an example of how to setup Sequelize and Express together in a project for NodeJS 10 and above.
Some features of this example
- It uses migrations
- It does not use
.sync() - It initializes the models in the
index.jsfolder
Feel free to download this and use as a starting point for your new project!
This example uses PostgreSQL as a database engine.
- Install PostgreSQL and run
$ createdb sequelize-blog - Install project dependencies with
npm installoryarn install - Run the migrations
$ sequelize db:migrate - Run the express server with
npm start - Open your browser in
localhost:3000and explore. Review theroutesfiles to see what endpoints are available.
MIT