Skip to content

Instantly share code, notes, and snippets.

@soroushjp
Forked from pgte/app.js
Created August 1, 2012 13:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soroushjp/3226854 to your computer and use it in GitHub Desktop.
Save soroushjp/3226854 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
block content
extends layout
block content
h2 Hello
p World!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment