Merge remote-tracking branch 'origin/master'
This commit is contained in:
15
README.md
15
README.md
@ -945,9 +945,8 @@ Replace `var app = express();` with the following code:
|
||||
|
||||
```js
|
||||
var app = express();
|
||||
var http = require('http');
|
||||
var server = http.createServer(app);
|
||||
var io = require('socket.io').listen(server);
|
||||
var server = require('http').Server(app);
|
||||
var io = require('socket.io')(server);
|
||||
```
|
||||
|
||||
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`:
|
||||
|
||||
```js
|
||||
io.configure(function() {
|
||||
io.set('transports', ['websocket']);
|
||||
});
|
||||
|
||||
io.sockets.on('connection', function(socket) {
|
||||
socket.emit('greet', { hello: 'Hey, Mr.Client!' });
|
||||
io.on('connection', function(socket) {
|
||||
socket.emit('greet', { hello: 'Hey there browser!' });
|
||||
socket.on('respond', function(data) {
|
||||
console.log(data);
|
||||
});
|
||||
@ -1004,7 +999,7 @@ script.
|
||||
var socket = io.connect(window.location.href);
|
||||
socket.on('greet', function (data) {
|
||||
console.log(data);
|
||||
socket.emit('respond', { message: 'Hello to you too, Mr.Server!' });
|
||||
socket.emit('respond', { message: 'Hey there, server!' });
|
||||
});
|
||||
```
|
||||
|
||||
|
18
package.json
18
package.json
@ -12,32 +12,32 @@
|
||||
"dependencies": {
|
||||
"async": "^0.9.0",
|
||||
"bcrypt-nodejs": "^0.0.3",
|
||||
"body-parser": "^1.6.2",
|
||||
"body-parser": "^1.6.4",
|
||||
"cheerio": "^0.17.0",
|
||||
"clockwork": "^0.1.1",
|
||||
"compression": "^1.0.10",
|
||||
"compression": "^1.0.11",
|
||||
"connect-assets": "^4.3.0",
|
||||
"connect-mongo": "^0.4.1",
|
||||
"cookie-parser": "^1.3.2",
|
||||
"csso": "^1.3.11",
|
||||
"errorhandler": "^1.1.1",
|
||||
"express": "^4.8.2",
|
||||
"express": "^4.8.4",
|
||||
"express-flash": "^0.0.2",
|
||||
"express-session": "^1.6.1",
|
||||
"express-session": "^1.7.5",
|
||||
"express-validator": "^2.3.0",
|
||||
"fbgraph": "^0.2.10",
|
||||
"github-api": "^0.7.0",
|
||||
"instagram-node": "^0.4.3",
|
||||
"jade": "^1.5.0",
|
||||
"lastfm": "^0.9.2",
|
||||
"less": "^1.7.3",
|
||||
"less": "^1.7.4",
|
||||
"lodash": "^2.4.1",
|
||||
"lusca": "^1.0.1",
|
||||
"method-override": "^2.1.2",
|
||||
"method-override": "^2.1.3",
|
||||
"mongoose": "^3.8.14",
|
||||
"morgan": "^1.2.2",
|
||||
"node-foursquare": "^0.2.1",
|
||||
"node-linkedin": "^0.3.0",
|
||||
"node-linkedin": "^0.3.2",
|
||||
"nodemailer": "^1.1.1",
|
||||
"passport": "^0.2.0",
|
||||
"passport-facebook": "^1.0.3",
|
||||
@ -49,11 +49,11 @@
|
||||
"passport-oauth": "^1.0.0",
|
||||
"passport-twitter": "^1.0.2",
|
||||
"request": "^2.40.0",
|
||||
"stripe": "^2.7.3",
|
||||
"stripe": "^2.8.0",
|
||||
"tumblr.js": "^0.0.4",
|
||||
"twilio": "^1.6.0",
|
||||
"twit": "^1.1.18",
|
||||
"uglify-js": "^2.4.14",
|
||||
"uglify-js": "^2.4.15",
|
||||
"validator": "^3.17.0",
|
||||
"yui": "^3.17.2"
|
||||
},
|
||||
|
2
setup.js
2
setup.js
@ -5,7 +5,7 @@ var multiline = require('multiline');
|
||||
|
||||
if (os.platform() === 'win32') {
|
||||
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('better CLI module.');
|
||||
console.log('*************************************************************');
|
||||
|
@ -6,10 +6,10 @@ block content
|
||||
i.fa.fa-yahoo(style='color: #7b0099')
|
||||
| Yahoo API
|
||||
.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
|
||||
| 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
|
||||
| YUI on Node.js
|
||||
a.btn.btn-primary(href='https://developer.yahoo.com/everything.html', target='_blank')
|
||||
|
Reference in New Issue
Block a user