Skip to content

Commit

Permalink
Issue #12: Compatible with Heroku deployment
Browse files Browse the repository at this point in the history
- Get port from process.env
  • Loading branch information
codebru committed Oct 27, 2019
1 parent e1a2aa7 commit b794227
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const RATELIMITINTERVAL = 1 * 60 * 1000; // 1 Min

/* INCLUDE CONFIGS ************************ */
dotenv.config();
const port = process.env.PORT || 3000
/* **************************************** */

/* INCLUDE ROUTES ************************ */
Expand Down Expand Up @@ -80,7 +81,7 @@ app.use('/user', user);
/* **************************************** */

/* SERVER START *************************** */
app.listen(3000, () => {
console.log('App listening on port 3000');
app.listen(port, () => {
console.log(`App listening on port ${port}`);
});
/* **************************************** */

0 comments on commit b794227

Please sign in to comment.