Skip to content

Commit eb2d362

Browse files
committed
Merge branch 'master' of github.com:DaftMonk/generator-angular-fullstack
2 parents 877e166 + ec29184 commit eb2d362

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

Diff for: app/templates/_package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"passport-google-oauth": "latest",<% } %>
2626
"composable-middleware": "^0.3.0",
2727
"connect-mongo": "^0.4.1"<% if(filters.socketio) { %>,
28-
"socket.io": "~1.0.6",
28+
"socket.io": "^1.0.6",
29+
"socket.io-client": "^1.0.6",
2930
"socketio-jwt": "^2.0.2"<% } %>
3031
},
3132
"devDependencies": {

Diff for: app/templates/client/components/socket(socketio)/socket.service(coffee).coffee

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ angular.module '<%= scriptAppName %>'
77

88
# socket.io now auto-configures its connection when we omit a connection url
99
ioSocket = io '',
10-
'reconnection limit': 10 * 1000
1110
# Send auth token on connection, you will need to DI the Auth service above
1211
# 'query': 'token=' + Auth.getToken()
12+
path: '/socket.io-client'
1313

1414
socket = socketFactory ioSocket: ioSocket
1515

@@ -64,4 +64,4 @@ angular.module '<%= scriptAppName %>'
6464
###
6565
unsyncUpdates: (modelName) ->
6666
socket.removeAllListeners modelName + ':save'
67-
socket.removeAllListeners modelName + ':remove'
67+
socket.removeAllListeners modelName + ':remove'

Diff for: app/templates/client/components/socket(socketio)/socket.service.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ angular.module('<%= scriptAppName %>')
88
var ioSocket = io('', {
99
// Send auth token on connection, you will need to DI the Auth service above
1010
// 'query': 'token=' + Auth.getToken()
11+
path: '/socket.io-client'
1112
});
1213

1314
var socket = socketFactory({
@@ -70,4 +71,4 @@ angular.module('<%= scriptAppName %>')
7071
socket.removeAllListeners(modelName + ':remove');
7172
}
7273
};
73-
});
74+
});

Diff for: app/templates/client/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@
4444
<script src="bower_components/es5-shim/es5-shim.js"></script>
4545
<script src="bower_components/json3/lib/json3.min.js"></script>
4646
<![endif]-->
47-
<% if(filters.socketio) { %> <script src="socket.io/socket.io.js"></script><% } %>
48-
<!-- build:js(client) app/vendor.js -->
47+
<!-- build:js({client<% if(filters.socketio) { %>,node_modules<% } %>}) app/vendor.js -->
4948
<!-- bower:js -->
5049
<!-- endbower -->
50+
<% if(filters.socketio) { %><script src="socket.io-client/socket.io.js"></script><% } %>
5151
<!-- endbuild -->
5252

5353
<!-- build:js({.tmp,client}) app/app.js -->

Diff for: app/templates/server/app.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ if(config.seedDB) { require('./config/seed'); }
2020
<% } %>// Setup server
2121
var app = express();
2222
var server = require('http').createServer(app);<% if (filters.socketio) { %>
23-
var socketio = require('socket.io').listen(server);
23+
var socketio = require('socket.io')(server, {
24+
serveClient: (config.env === 'production') ? false : true,
25+
path: '/socket.io-client'
26+
});
2427
require('./config/socketio')(socketio);<% } %>
2528
require('./config/express')(app);
2629
require('./routes')(app);
@@ -31,4 +34,4 @@ server.listen(config.port, config.ip, function () {
3134
});
3235

3336
// Expose app
34-
exports = module.exports = app;
37+
exports = module.exports = app;

0 commit comments

Comments
 (0)