Skip to content

Instantly share code, notes, and snippets.

@pgte
Created November 16, 2010 17:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save pgte/702084 to your computer and use it in GitHub Desktop.
Save pgte/702084 to your computer and use it in GitHub Desktop.
Node Tuts episode 9 - Express
var express = require('express');
var app = express.createServer();
app.configure('development', function () {
app.use(express.logger());
app.use(express.errorHandler({
dumpExceptions: true,
showStack: true
}));
});
app.configure('production', function () {
app.use(express.logger());
app.use(express.errorHandler());
});
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
app.set('view options', {layout: true});
app.get('/', function(req, res) {
res.render('root');
});
app.listen(4000);
!!! 5
html
head
title My template
body
h1 Content goes here
#container!= body
h2 Hello
p World!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment