FRONTEND_URL is the new addition to the .env file, all could be found in .env.sample aside from frontend url. It's the url of the frontend that would be whitelisted in cors. By default, frontend runs on port 9001.
NOTE
FRONTEND_URL variable is needed for cors whitelisting.
APP_PORT=4000
DB_HOST=localhost
DB_USER=root
DB_PASS=password
DB_NAME=development-student-management
DB_DIALECT=mysql
DB_PORT=3306
APP_HOST=localhost
NODE_ENV=development
FRONTEND_URL=http://localhost:9001
npm i
This drops the existing db and creates a new one from the Models instead of migrations.
npm run reset
Insert initial data to db.
script:
npm run seed
data inserted:
Students
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
Tutors
[email protected]
[email protected]
[email protected]
This runs our express app:
npm run dev
Before running the script, add your .env.test
APP_PORT=4000
DB_HOST=localhost
DB_USER=root
DB_PASS=password
DB_NAME=development-student-management
DB_DIALECT=mysql
DB_PORT=3306
APP_HOST=localhost
NODE_ENV=development
FRONTEND_URL=http://localhost:9001
NOTE
FRONTEND_URL variable is needed for cors whitelisting.
FRONTEND_URL is http://localhost:9001
by default, unless there's a different port set for frontend.
Running the test cases
npm run test