From c8b6d3b4f3bb8677b259a8c5be2e9611004347c0 Mon Sep 17 00:00:00 2001 From: johnyma22 Date: Wed, 12 Sep 2012 19:38:53 +0100 Subject: [PATCH] attempt to put correct init in right place but could be wrong --- src/node/hooks/express.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/node/hooks/express.js b/src/node/hooks/express.js index 1f4a6f2cc..e4ff40d96 100644 --- a/src/node/hooks/express.js +++ b/src/node/hooks/express.js @@ -42,12 +42,13 @@ exports.createServer = function () { } exports.restartServer = function () { + if (server) { console.log("Restarting express server"); server.close(); } - server = express.createServer(); + server = express(); // New syntax for express v3 server.use(function (req, res, next) { res.header("Server", serverName); @@ -60,4 +61,4 @@ exports.restartServer = function () { hooks.callAll("expressCreateServer", {"app": server}); server.listen(settings.port, settings.ip); -} \ No newline at end of file +}