Skip to content

Commit bbd16f1

Browse files
author
Jason Kridner
committed
server: fix server
* Updated to Express v4 * Updated to Socket.io v1 * Fixed real issue by updating the path to main.js
1 parent db6dedd commit bbd16f1

2 files changed

Lines changed: 5 additions & 11 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
"node": ">= 0.8.16"
2727
},
2828
"dependencies": {
29-
"socket.io": "0.8.7",
29+
"socket.io": "1.2.1",
3030
"systemd": "0.2.6",
3131
"winston": "0.6.2",
32-
"express": "3.1.0",
32+
"express": "4.10.4",
3333
"ffi": "1.2.6"
3434
},
3535
"optionalDependencies": {

src/server.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ exports.serverStart = function(port, directory, callback) {
4040
function listen(port, directory) {
4141
winston.info("Opening port " + port + " to serve up " + directory);
4242
var app = express();
43-
app.use(express.logger());
4443
app.get('/bonescript.js', handler);
4544
app.use(express.static(directory));
4645
var server = http.createServer(app);
@@ -71,14 +70,9 @@ function handler(req, res) {
7170
}
7271

7372
function addSocketListeners(server) {
74-
var io = socketio.listen(server);
75-
if(!debug) io.set('log level', 0);
76-
io.set('heartbeats', true);
77-
io.set('polling duration', 1);
78-
io.set('heartbeat interval', 2);
79-
io.set('heartbeat timeout', 10);
73+
var io = socketio(server);
8074
if(debug) winston.debug('Listening for new socket.io clients');
81-
io.sockets.on('connection', onconnect);
75+
io.on('connection', onconnect);
8276
function onconnect(socket) {
8377
winston.debug('Client connected');
8478

@@ -136,7 +130,7 @@ function addSocketListeners(server) {
136130
socket.on(message, onFuncMessage);
137131
};
138132

139-
var b = require('../index');
133+
var b = require('../main');
140134
for(var i in b) {
141135
if(typeof b[i] == 'function') {
142136
if(typeof b[i].args != 'undefined') {

0 commit comments

Comments
 (0)