Created
September 17, 2016 07:33
-
-
Save twhite96/a7eff91fda64dd80a20d6ac454b80718 to your computer and use it in GitHub Desktop.
Serving static files with an Express server on Heroku
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
var express = require('express'); | |
var app = express(); | |
app.use(express.static('public')); | |
var port = process.env.PORT || 8080; | |
app.get('/', function (req, res) { | |
res.send('Hello World!'); | |
}); | |
app.listen(port, function () { | |
console.log('Example app listening on port 3000!'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment