Merge remote-tracking branch 'origin/master'

This commit is contained in:
Sahat Yalkabov
2014-09-01 12:13:07 -07:00
4 changed files with 18 additions and 23 deletions

View File

@ -945,9 +945,8 @@ Replace `var app = express();` with the following code:
```js ```js
var app = express(); var app = express();
var http = require('http'); var server = require('http').Server(app);
var server = http.createServer(app); var io = require('socket.io')(server);
var io = require('socket.io').listen(server);
``` ```
I like to have the following code organization in `app.js` (from top to bottom): module dependencies, I like to have the following code organization in `app.js` (from top to bottom): module dependencies,
@ -957,12 +956,8 @@ start the server, socket.io stuff. That way I always know where to look for thin
Add the following code at the end of `app.js`: Add the following code at the end of `app.js`:
```js ```js
io.configure(function() { io.on('connection', function(socket) {
io.set('transports', ['websocket']); socket.emit('greet', { hello: 'Hey there browser!' });
});
io.sockets.on('connection', function(socket) {
socket.emit('greet', { hello: 'Hey, Mr.Client!' });
socket.on('respond', function(data) { socket.on('respond', function(data) {
console.log(data); console.log(data);
}); });
@ -1004,7 +999,7 @@ script.
var socket = io.connect(window.location.href); var socket = io.connect(window.location.href);
socket.on('greet', function (data) { socket.on('greet', function (data) {
console.log(data); console.log(data);
socket.emit('respond', { message: 'Hello to you too, Mr.Server!' }); socket.emit('respond', { message: 'Hey there, server!' });
}); });
``` ```

View File

@ -12,32 +12,32 @@
"dependencies": { "dependencies": {
"async": "^0.9.0", "async": "^0.9.0",
"bcrypt-nodejs": "^0.0.3", "bcrypt-nodejs": "^0.0.3",
"body-parser": "^1.6.2", "body-parser": "^1.6.4",
"cheerio": "^0.17.0", "cheerio": "^0.17.0",
"clockwork": "^0.1.1", "clockwork": "^0.1.1",
"compression": "^1.0.10", "compression": "^1.0.11",
"connect-assets": "^4.3.0", "connect-assets": "^4.3.0",
"connect-mongo": "^0.4.1", "connect-mongo": "^0.4.1",
"cookie-parser": "^1.3.2", "cookie-parser": "^1.3.2",
"csso": "^1.3.11", "csso": "^1.3.11",
"errorhandler": "^1.1.1", "errorhandler": "^1.1.1",
"express": "^4.8.2", "express": "^4.8.4",
"express-flash": "^0.0.2", "express-flash": "^0.0.2",
"express-session": "^1.6.1", "express-session": "^1.7.5",
"express-validator": "^2.3.0", "express-validator": "^2.3.0",
"fbgraph": "^0.2.10", "fbgraph": "^0.2.10",
"github-api": "^0.7.0", "github-api": "^0.7.0",
"instagram-node": "^0.4.3", "instagram-node": "^0.4.3",
"jade": "^1.5.0", "jade": "^1.5.0",
"lastfm": "^0.9.2", "lastfm": "^0.9.2",
"less": "^1.7.3", "less": "^1.7.4",
"lodash": "^2.4.1", "lodash": "^2.4.1",
"lusca": "^1.0.1", "lusca": "^1.0.1",
"method-override": "^2.1.2", "method-override": "^2.1.3",
"mongoose": "^3.8.14", "mongoose": "^3.8.14",
"morgan": "^1.2.2", "morgan": "^1.2.2",
"node-foursquare": "^0.2.1", "node-foursquare": "^0.2.1",
"node-linkedin": "^0.3.0", "node-linkedin": "^0.3.2",
"nodemailer": "^1.1.1", "nodemailer": "^1.1.1",
"passport": "^0.2.0", "passport": "^0.2.0",
"passport-facebook": "^1.0.3", "passport-facebook": "^1.0.3",
@ -49,11 +49,11 @@
"passport-oauth": "^1.0.0", "passport-oauth": "^1.0.0",
"passport-twitter": "^1.0.2", "passport-twitter": "^1.0.2",
"request": "^2.40.0", "request": "^2.40.0",
"stripe": "^2.7.3", "stripe": "^2.8.0",
"tumblr.js": "^0.0.4", "tumblr.js": "^0.0.4",
"twilio": "^1.6.0", "twilio": "^1.6.0",
"twit": "^1.1.18", "twit": "^1.1.18",
"uglify-js": "^2.4.14", "uglify-js": "^2.4.15",
"validator": "^3.17.0", "validator": "^3.17.0",
"yui": "^3.17.2" "yui": "^3.17.2"
}, },

View File

@ -5,7 +5,7 @@ var multiline = require('multiline');
if (os.platform() === 'win32') { if (os.platform() === 'win32') {
console.log('*************************************************************'); console.log('*************************************************************');
console.log('Hackthon Starter Generator has been disalbed on Windows until'); console.log('Hackthon Starter Generator has been disabled on Windows until');
console.log('https://github.com/chjj/blessed is fixed or until I find a'); console.log('https://github.com/chjj/blessed is fixed or until I find a');
console.log('better CLI module.'); console.log('better CLI module.');
console.log('*************************************************************'); console.log('*************************************************************');

View File

@ -6,10 +6,10 @@ block content
i.fa.fa-yahoo(style='color: #7b0099') i.fa.fa-yahoo(style='color: #7b0099')
| Yahoo API | Yahoo API
.btn-group.btn-group-justified .btn-group.btn-group-justified
a.btn.btn-primary(href='http://instagram.com/developer/', target='_blank') a.btn.btn-primary(href='https://developer.yahoo.com/yql/', target='_blank')
i.fa.fa-check-square-o i.fa.fa-check-square-o
| YQL Getting Started | YQL Getting Started
a.btn.btn-primary(href='https://developer.yahoo.com/yql/', target='_blank') a.btn.btn-primary(href='https://yuilibrary.com/yui/docs/yui/nodejs.html', target='_blank')
i.fa.fa-laptop i.fa.fa-laptop
| YUI on Node.js | YUI on Node.js
a.btn.btn-primary(href='https://developer.yahoo.com/everything.html', target='_blank') a.btn.btn-primary(href='https://developer.yahoo.com/everything.html', target='_blank')