diff options
author | Mateja <mail@matejamaric.com> | 2021-05-06 18:46:59 +0200 |
---|---|---|
committer | Mateja <mail@matejamaric.com> | 2021-05-06 18:46:59 +0200 |
commit | e49326610cb7843c8d905fcb04e57eeaed9d3cad (patch) | |
tree | b1dcbb0adf6d2e8052eaddf55367612e25daf3d6 | |
parent | 7a0d256d2fabd2f1d583cea6ab0d64dcec12e45a (diff) | |
download | node-playground-e49326610cb7843c8d905fcb04e57eeaed9d3cad.tar.gz node-playground-e49326610cb7843c8d905fcb04e57eeaed9d3cad.zip |
Use PORT environment variable.
-rw-r--r-- | .env.example | 1 | ||||
-rw-r--r-- | index.js | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/.env.example b/.env.example index 980afd3..ca2f89b 100644 --- a/.env.example +++ b/.env.example @@ -1,2 +1,3 @@ +PORT=8080 DB_CONN=mongodb://localhost/playground_db APP_SECRET=replace-this @@ -36,4 +36,4 @@ app.use(express.urlencoded({extended: false})); app.use('/', webRoutes); -app.listen(8080, () => console.log('Server started on port 8080.')); +app.listen(process.env.PORT, () => console.log(`Server started on port ${process.env.PORT}.`)); |