-
-
Save simeg/52b1bf277d5fe447239b379ea41346d0 to your computer and use it in GitHub Desktop.
Express Node.js Heroku 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// index.js | |
const express = require('express'); | |
const app = express(); | |
// Use port from Heroku, fall back to default port | |
const port = process.env.PORT || 3000; | |
app.get('/', (req, res) => { | |
res.send('Hello World!'); | |
}); | |
app.listen(port, () => { | |
console.log(`App available at http://localhost:${port}`); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment