Skip to content

Commit

Permalink
update app listener port with .env variable (#140)
Browse files Browse the repository at this point in the history
* update app listener port with .env variable

* add default port value
  • Loading branch information
IsaacJrTypes authored Aug 15, 2024
1 parent ceba08e commit c68f7d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Copy and rename to .env to use environment variables
# dev environment vars

PORT=3000

# staging environment vars


# local environment vars
# local environment vars
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ async function bootstrap() {
// TODO: set env variable here
origin: 'http://localhost:3001', // the frontend (next.js) server
}*/);
await app.listen(3000);
await app.listen(process.env.PORT||3001);
}
bootstrap();

0 comments on commit c68f7d3

Please sign in to comment.