Skip to content

Instantly share code, notes, and snippets.

@codelotus
Created September 4, 2010 21:31
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 codelotus/565508 to your computer and use it in GitHub Desktop.
Save codelotus/565508 to your computer and use it in GitHub Desktop.
// app.js
app.configure(function(){
app.use(express.staticProvider(pub));
app.set('views', __dirname + '/views')
app.set('view engine', 'ejs')
app.use(connect.bodyDecoder())
app.use(express.errorHandler({ showStack: true, dumpExceptions: true }))
// app.helpers({
// name: function(first, last){ return first + ', ' + last },
// firstName: 'tj',
// lastName: 'holowaychuk'
// })
})
app.helpers({
name: function(first, last){ return first + ', ' + last },
firstName: 'tj',
lastName: 'holowaychuk'
})
// views/test.ejs
<h2 >Body: <%= name(firstName, lastName) %></h2>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment