Tuesday, 15 September 2015

node.js - socket.io don't support express3? -



node.js - socket.io don't support express3? -

i started larn socket.io , express3 found when -

var app = require('express').createserver() var io = require('socket.io').listen(app); app.listen(8080);

it writes console express.createserver() deprecated.

i googled couldn't find answers that..what should do? maybe should downgrade express or something?

have close @ documentation. you'll see there key difference between using socket.io in section: "using express 3 web framework" vs "using express web framework". illustration give is:

var app = require('express')() , server = require('http').createserver(app) , io = require('socket.io').listen(server); server.listen(80);

just follow pattern , you'll set.

node.js express socket.io

No comments:

Post a Comment