app.get '/jade/*', (req, res) ->
fs.readFile app.get('views') + "/#{req.params}.jade", 'utf-8', (err, tpl) ->
res.json err if err
functionBody = jade.compile(
tpl, client:true, compileDebug:false
).toString().replace 'anonymous', ''
res.set 'Content-Type', 'application/javascript'
res.send """
define([], function(){
return #{functionBody}
});
Created
December 18, 2012 00:55
-
-
Save Sigmus/4323956 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment