Skip to content

Instantly share code, notes, and snippets.

@twhite96
Created September 17, 2016 07:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save twhite96/a7eff91fda64dd80a20d6ac454b80718 to your computer and use it in GitHub Desktop.
Save twhite96/a7eff91fda64dd80a20d6ac454b80718 to your computer and use it in GitHub Desktop.
Serving static files with an Express server on Heroku
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