To set up your node enviroment
- Install node.js
It's pretty straightforward. Please follow this link
Please follow this link
- To begin your server, start by installing all the dependencies:
npm install-
To start the dev server:
npm run start-dev-serverwill use nodemon. Read more about nodemon here -
Create a
.env.localfile: This file will serve as your local .env file that will contain all the environment variables for the database and the jsonwebtoken verification secret for development. -
You do not need to run the
npm run db-initcommand. Theknexfile.jshas already been created. Only these commands will be of use to you:-
npm run db-make-migration migration_namee.gnpm run db-make-migration create_courses_table -
npm run db-migrate-devwill update your local database with the latest migrations -
npm run db-migrate-up: To run the specified migration that has not yet been run e.gnpm run db-migrate-up 20231107222319_create_courses_table.js, assuming it was the last migration you made. Running the command without a specified migration file also runs the last migration that was made i.enpm run db-migrate-up -
npm run db-migrate-down: To undo the last run migration. Like above, the migration file can also be specified.Please refer to this documentation about knex migrations.
-
This project is MIT licensed.