Skip to content

Instantly share code, notes, and snippets.

@donwb
Created June 28, 2011 04:03
Show Gist options
  • Save donwb/1050464 to your computer and use it in GitHub Desktop.
Save donwb/1050464 to your computer and use it in GitHub Desktop.
slight bit of CoffeeScript to invoke a CoffeeKup view passing data
express = require('express')
app = express.createServer()
# Setup Template Engine
app.register '.coffee', require('coffeekup')
app.set 'view engine', 'coffee'
# Setup Static Files
app.use express.static(__dirname + '/public')
# App Routes
app.get '/', (request, response) ->
response.render 'index', { mytitle: 'my express' }
# Listen
app.listen 3000
@chrisjpowers
Copy link

I think you need to add the context key to Line #13:

response.render 'index', context: { mytitle: 'my express' }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment