From 7b3f78d70c9cac87806d0a0140b22a2976518940 Mon Sep 17 00:00:00 2001 From: Jiri Spac Date: Tue, 23 Aug 2016 02:00:37 +0200 Subject: [PATCH] check the server parameter --- index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.js b/index.js index 1023b0e..5e7687c 100644 --- a/index.js +++ b/index.js @@ -68,6 +68,9 @@ const gatherOsMetrics = (io, span) => { const encoding = {encoding: 'utf8'} const middlewareWrapper = (app, config) => { + if (!app.listen) { + throw new Error('First parameter must be an http server') + } io = require('socket.io')(app) Object.assign(defaultConfig, config) config = defaultConfig