Guest User

Untitled

a guest
Jun 19th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. var express = require('express'),
  2. YUI = require('yui3').YUI,
  3. app = express.createServer();
  4.  
  5. YUI({
  6. debug: false
  7. }).use('express', 'node', function(Y) {
  8. app.configure(function(){
  9. app.set('views', process.cwd());
  10. app.set('partials', process.cwd());
  11. app.use(app.router);
  12. });
  13.  
  14. app.register('.html', YUI);
  15.  
  16. app.get('/', function(req, res, next){
  17. console.log("GET /");
  18. res.render('index.html', {
  19. locals: {
  20. partials: [
  21. {
  22. name: 'header',
  23. node: '#header'
  24. }
  25. ],
  26. content: '#content'
  27. }
  28. });
  29. });
  30.  
  31. if (!module.parent) {
  32. app.listen(3200)
  33. console.log("Express server listening on port " + app.address().port)
  34. }
  35. });
Add Comment
Please, Sign In to add comment