-
Notifications
You must be signed in to change notification settings - Fork 10
Express3 usage
malgorithms edited this page Oct 25, 2012
·
4 revisions
If you haven't yet, install the toffee
module:
> npm install -g toffee
In Express 3.x to make it your default engine:
app.set 'view engine', 'toffee'
In Express 3.x to use it just for .toffee files:
toffee = require 'toffee'
app.engine 'toffee', toffee.__express
Yes, this works. If you publish a file foo.toffee
and pass a layout
filename to it as a var, foo.toffee
is rendered, and the results are put into
a var called body
.
Inside your layout file, to print the body, do this:
#{raw body}