Created
June 23, 2011 15:38
-
-
Save caridy/1042783 to your computer and use it in GitHub Desktop.
yui vs persistent Y
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 http = require('http'); | |
var YUI = require('yui3').YUI; | |
// persistent Y | |
var global_Y = YUI({ | |
fetchCSS: false, | |
useConsoleOutput: false | |
}); | |
http.createServer(function (req, res) { | |
if (req.url == '/yui') { | |
YUI({ | |
fetchCSS: false, | |
useConsoleOutput: false | |
}).use('anim', 'datatype', 'event-valuechange', 'node-flick', 'resize', 'text', 'arraysort', 'console', 'dd', 'highlight', 'node-focusmanager', 'scrollview', 'transition', 'cookie', 'dial', 'history', 'node-menunav', 'uploader', 'async-queue', 'dom', 'oop', 'slider', 'widget', 'attribute', 'dump', 'imageloader', 'overlay', 'sortable', 'widget-anim', 'autocomplete', 'editor', 'intl', 'plugin', 'stylesheet', 'yql', 'base', 'io', 'pluginhost', 'substitute', 'cache', 'event', 'json', 'profiler', 'swf', 'charts', 'dataschema', 'event-custom', 'jsonp', 'querystring', 'swfdetect', 'classnamemanager', 'datasource', 'event-gestures', 'loader', 'queue-promote', 'collection', 'datatable', 'event-simulate', 'node', 'recordset', function(Y) { | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
res.end('\nBrand New YUI Instance\n'); | |
}); | |
} | |
else { | |
global_Y.use('anim', 'datatype', 'event-valuechange', 'node-flick', 'resize', 'text', 'arraysort', 'console', 'dd', 'highlight', 'node-focusmanager', 'scrollview', 'transition', 'cookie', 'dial', 'history', 'node-menunav', 'uploader', 'async-queue', 'dom', 'oop', 'slider', 'widget', 'attribute', 'dump', 'imageloader', 'overlay', 'sortable', 'widget-anim', 'autocomplete', 'editor', 'intl', 'plugin', 'stylesheet', 'yql', 'base', 'io', 'pluginhost', 'substitute', 'cache', 'event', 'json', 'profiler', 'swf', 'charts', 'dataschema', 'event-custom', 'jsonp', 'querystring', 'swfdetect', 'classnamemanager', 'datasource', 'event-gestures', 'loader', 'queue-promote', 'collection', 'datatable', 'event-simulate', 'node', 'recordset', function(Y) { | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
res.end('\nPersistent YUI Instance\n'); | |
}); | |
} | |
}).listen(1337, "127.0.0.1"); | |
console.log('Server running at http://127.0.0.1:1337/'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment