Skip to content
This repository has been archived by the owner on Oct 11, 2022. It is now read-only.

Commit

Permalink
Listen on port set with env var PORT
Browse files Browse the repository at this point in the history
  • Loading branch information
trisberg authored Jan 4, 2022
1 parent 5cd689b commit fd9270e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions server.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
const express = require('express')
const app = express()
const port = 3000
const express = require('express');
const app = express();
const port = process.env.PORT || 3000;

app.get('/', (req, res) => {
res.send('Hello from the server!')
})
res.send('Hello from the server!');
});

app.get('/health', (req, res) => {
res.sendStatus(200);
})
});

app.listen(port, () => {
console.log(`app listening at http://localhost:${port}`)
})
console.log(`app listening at http://localhost:${port}`);
});

0 comments on commit fd9270e

Please sign in to comment.