From 6afbb3458188d6058e58d02c5a882bdf08f2ba3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Aure=CC=81lio?= Date: Mon, 30 Jul 2012 15:43:00 -0300 Subject: [PATCH] Add warning to .listen() to ease the migration to Express 3.x --- lib/socket.io.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/socket.io.js b/lib/socket.io.js index 62199d442c..3c6c9ccbff 100644 --- a/lib/socket.io.js +++ b/lib/socket.io.js @@ -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 = {};