Added socket.io generator UI

This commit is contained in:
Sahat Yalkabov
2014-05-13 01:13:27 -04:00
parent 573657d643
commit bd27d39ecc
2 changed files with 19 additions and 8 deletions

View File

@ -48,6 +48,7 @@
"passport-oauth": "^1.0.0", "passport-oauth": "^1.0.0",
"passport-twitter": "^1.0.2", "passport-twitter": "^1.0.2",
"request": "^2.34.0", "request": "^2.34.0",
"socket.io": "^0.9.16",
"stripe": "^2.5.5", "stripe": "^2.5.5",
"tumblr.js": "^0.0.4", "tumblr.js": "^0.0.4",
"twilio": "^1.6.0", "twilio": "^1.6.0",

View File

@ -6,6 +6,10 @@ var screen = blessed.screen({
autoPadding: true autoPadding: true
}); });
screen.key('q', function() {
process.exit(0);
});
var home = blessed.list({ var home = blessed.list({
parent: screen, parent: screen,
padding: { top: 2 }, padding: { top: 2 },
@ -389,19 +393,19 @@ home.on('select', function(child, index) {
email.focus(); email.focus();
break; break;
case 2: case 2:
home.append(inner); enableSocketIo();
inner.append(socketText); home.append(success);
inner.focus(); success.setContent('Socket.IO events have been added at the bottom of {underline}app.js{/underline}. To see a working example take a look at /dashboard. Be sure to run npm install socket.io');
success.focus();
screen.render(); screen.render();
break; break;
case 3: case 3:
// Cluster // Cluster
addClusterSupport(); addClusterSupport();
home.append(success); home.append(success);
success.setContent('New file {underline}cluster_app.js{/underline} has been created. Your app is now able to use more than 1 CPU by running node {underline}cluster_app.js{/underline}, which in turn spawns multiple instances of {underline}app.js{/underline}'); success.setContent('New file {underline}cluster_app.js{/underline} has been created. Your app is now able to use more than 1 CPU by running {underline}node cluster_app.js{/underline}, which in turn spawns multiple instances of {underline}app.js{/underline}');
success.focus(); success.focus();
screen.render(); screen.render();
break; break;
default: default:
process.exit(0); process.exit(0);
@ -409,9 +413,7 @@ home.on('select', function(child, index) {
}); });
screen.key('q', function() {
process.exit(0);
});
screen.render(); screen.render();
@ -441,3 +443,11 @@ for (var i = 0; i < os.cpus().length; i++) {
fs.writeFileSync('cluster_app.js', fileContents); fs.writeFileSync('cluster_app.js', fileContents);
} }
function enableSocketIo() {
var fileContents = multiline(function() {
/*
*/
});
}