- Download this template from github and open it in your favourite text editor.
- Go inside the folder path and execute the following command:
npm install
-
In the root directory create a
.envfile and add the following env variablesPORT=<port number of your choice>ex:
PORT=3000 -
go inside the
srcfolder and execute the following command:npx sequelize init -
By executing the above command you will get migrations and seeders folder along with a config.json inside the config folder.
-
If you're setting up your development environment, then write the username of your db, password of your db and in dialect mention whatever db you are using for ex: mysql, mariadb etc
-
If you're setting up test or prod environment, make sure you also replace the host with the hosted db url.
-
Now execute following command
npx sequelize db:migrate -
To run the server execute
npm run dev