Created
June 24, 2012 22:05
-
-
Save matthewmueller/2985181 to your computer and use it in GitHub Desktop.
Javascript: express 3 boilerplate
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'), | |
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