Skip to content

pupilfirst/wd301-api

Repository files navigation

wd301-api

API server for WD301

steps to run locally

npm install
npm start

Running in production

  • Install pm2
npm install pm2 -g
  • Add environment variables to .env file (Refer .env.sample file)
DATABASE_URL="postgres://postgres:postgres@localhost:5432/wd301_db"
PORT=8081
JWT_SECRET="your_jwt_secret"
SALT_ROUNDS=10
  • Make sure the database exists
cd wd301-api
NODE_ENV=production npx sequelize-cli db:create
  • Run the application
cd wd301-api
NODE_ENV=production pm2 start "npx sequelize-cli db:migrate && npm start" --name wd301-api
  • Stopping the application
pm2 stop wd301-api
  • You can get the logs for the application by running
pm2 logs

HTTPS support

You can use Nginx or any other reverse proxy to terminate any SSL connections.

About

API used in WD301 course.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages