Skip to content

Commit

Permalink
port as an environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
fichimura committed Mar 27, 2024
1 parent ac954ee commit 2a36d94
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ app.use((err, req, res, next) => {
res.status(statusCode).render('errorTemplates/error', { err });
});

app.listen(3000, () => {
console.log("LISTENING ON PORT 3000");
const port = process.env.PORT || 3000;

app.listen(port, () => {
console.log(`LISTENING ON PORT ${port}`);
});

0 comments on commit 2a36d94

Please sign in to comment.