From 329cf05f26fe445df69e30e08c647fad2fb570e3 Mon Sep 17 00:00:00 2001 From: Isaac J Date: Mon, 29 Jul 2024 21:17:08 -0700 Subject: [PATCH] update app listener port with .env variable --- .env.sample | 5 +++-- src/main.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.env.sample b/.env.sample index 1495108..a38b355 100644 --- a/.env.sample +++ b/.env.sample @@ -1,7 +1,8 @@ +# Copy and rename to .env to use environment variables # dev environment vars - +PORT=3000 # staging environment vars -# local environment vars \ No newline at end of file +# local environment vars diff --git a/src/main.ts b/src/main.ts index ad098db..3d5c77d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -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); } bootstrap();