Skip to content

Instantly share code, notes, and snippets.

@matthewmueller
Created June 24, 2012 22:05
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 matthewmueller/2985181 to your computer and use it in GitHub Desktop.
Save matthewmueller/2985181 to your computer and use it in GitHub Desktop.
Javascript: express 3 boilerplate
var express = require('express'),
cons = require('consolidate'),
port = process.argv[2] || 8080,
app = express();
app.engine('html', cons.hogan);
app.set('view engine', 'html');
app.set('views', __dirname);
app.configure(function() {
app.use(express['static'](__dirname));
});
app.get('/', function(req, res) {
res.render('index');
});
app.listen(port);
console.log('Listening on port', port);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment