Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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');
Add Comment
Please, Sign In to add comment