Guest User

Untitled

a guest
Jun 18th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. var path = require('path'),
  2. fs = require('fs'),
  3. express = require('express'),
  4. YUI = require('yui3').YUI;
  5.  
  6. var app = module.exports = express.createServer();
  7.  
  8. YUI({
  9. debug: true
  10. }).use('dump', 'node', 'express', function(Y){
  11.  
  12. app.configure(function(){
  13. app.set('views', process.cwd());
  14. app.use(express.logger());
  15. app.use(app.router);
  16. });
  17.  
  18. app.register('.html', YUI);
  19.  
  20. Y.log("Hello World!");
  21. Y.log(Y.dump({hello: 'world'}));
  22.  
  23. app.get('/log', function(req, res, next){
  24. Y.log('app.get log');
  25. Y.log(Y.dump(req));
  26. res.render('y.html', {
  27. locals: {
  28. content: "#content",
  29. after: function(Y, options, partial) {
  30. Y.log('res.render after');
  31. Y.log(Y.dump(res));
  32. }
  33. }
  34. });
  35. });
  36. });
  37.  
  38. app.listen('3000');
Add Comment
Please, Sign In to add comment