A simple books api service
To start the project in development mode, run:
npm run dev
This will start the local MongoDB server and the Express server.
Set your Node.js environment to production in package.json
"start": "NODE_ENV=production node server.js"
Set your port
number to refer to process.env.PORT
when process.env.NODE_ENV
is in production
.
const port = process.env.NODE_ENV === "production" ? process.env.PORT : 8080;
See instructions to deploy your project to Heroku with Heroku CLI.
To view logs, run the following command.
heroku logs --tail