Skip to content

Commit

Permalink
Merge pull request socketio#971 from Coreh/express-3.x-warn
Browse files Browse the repository at this point in the history
Add warning to .listen() to ease the migration to Express 3.x
  • Loading branch information
rauchg committed Jul 30, 2012
2 parents ac39dbc + 6afbb34 commit c795e4c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/socket.io.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ exports.clientVersion = client.version;
*/

exports.listen = function (server, options, fn) {
if ('function' == typeof server) {
console.warn('Socket.IO\'s `listen()` method expects an `http.Server` instance\n'
+ 'as its first parameter. Are you migrating from Express 2.x to 3.x?\n'
+ 'If so, check out the "Socket.IO compatibility" section at:\n'
+ 'https://github.com/visionmedia/express/wiki/Migrating-from-2.x-to-3.x');
}

if ('function' == typeof options) {
fn = options;
options = {};
Expand Down

0 comments on commit c795e4c

Please sign in to comment.