Make company global travel and accommodation easy and convenient for the strong workforce of savvy members of staff, by leveraging the modern web.
- Get some stuffs on table
- Run
npm install
- Create
.env
in project root directory - Take a look at the
.env.example
file which is in the project root directory to have a clue on environment variables that are being used in this project - Copy all keys from the
.env.example
file to.env
file and add values to corresponding keys. These can be obtained from the project administrator - Feel free to add other keys and values according to your feature requirements
Note: Add keys in
.env.example
to ease next setup for other developers.
- Time to serve
-
For you to use your new environment variable you have to import
dotenv
module in the file where you want to utilise your environment variables and configure it. like this:import dotenv from 'dotenv'; dotenv.config();
-
Then you'll be able to access your environment variables via
process.env.YOUR_KEY
-
That's it, you're good to go!, happy coding!
- Configuring
.env
- Download and install pgAdmin
- Create two databases, one for testing and another for development.
- Copy
DATABASE_DEV_URL=postgres://your_db_user:your_password@127.0.0.1:5432/your_dev_db_name
DATABASE_TEST_URL=postgres://your_db_user:your_password@127.0.0.1:5432/your_test_db_name
URLs from.env.example
to.env
- Edit them with your real database user, password and database name.
- Running Migrations
- Run
npm run migrateDb
in terminal to fire up migration
- Run
- Undoing Migrations
- Run
npm run revertMigration
to undo all migrations
- Running Seeds
- Run
npm run seedDb
in terminal to run all seeds
- Undoing Seeds
- Run
npm run revertSeed
in termninal to undo all seeds data from the database
- Run
npm run dev
in terminal
- Run
npm run test
in terminal