First Download repository from git/github
After download, use this command to install depedencies.
npm install
In file config fill the "username
" and "password
" to connect to database, you can find the file in this directory below.
## src/config/config.json
{
"development": {
"username": "postgress",
"password": "123456",
"database": "ch6challange",
"host": "127.0.0.1",
"dialect": "postgres"
}
}
To create database use this command.
npx sequelize-cli db:create
to check database "ch6challange"
is created, open apps "dbeaver tools"
and login with authentication on your environment database username
and password
.
After create database, then run this command to create and migrate tables into database "ch6challange"
.
npx sequelize-cli db:migrate
Use this command to add dummy data in table Usergame.
npx sequelize-cli db:seed:all
to delete data dummy in table Usergame you can use command.
npx sequelize-cli db:seed:undo
run app with command in terminal.
node index.js
or
nodemon index.js
if you run the app in development mode.
And then open this link to browser http://localhost:8000 and use this account to login.
username: admin
password: admin