Skip to content

Instantly share code, notes, and snippets.

@davglass
Created October 15, 2010 12:36
Show Gist options
  • Save davglass/628112 to your computer and use it in GitHub Desktop.
Save davglass/628112 to your computer and use it in GitHub Desktop.
var path = require('path'),
fs = require('fs'),
express = require('express'),
YUI = require('yui3').YUI;
var app = module.exports = express.createServer();
YUI({
debug: true
}).use('dump', 'node', 'express', function(Y){
app.configure(function(){
app.set('views', process.cwd());
app.use(express.logger());
app.use(app.router);
});
app.register('.html', YUI);
Y.log("Hello World!");
Y.log(Y.dump({hello: 'world'}));
app.get('/log', function(req, res, next){
Y.log('app.get log');
Y.log(Y.dump(req));
res.render('y.html', {
locals: {
content: "#content",
after: function(aY, options, partial) {
//aY is a reference to the document in the request
//Y is the global Y instance you created above.
Y.log('res.render after');
Y.log(Y.dump(res));
}
}
});
});
});
app.listen('3000');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment