-
-
Save davglass/628112 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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