From 23ff346acff460c562010fd4574426c825c97fac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1igo=20Beitia?= Date: Sun, 12 Oct 2014 17:16:35 +0700 Subject: [PATCH 1/4] Update package.json Express v4 dependency --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c36cd64..0159089 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ , "dependencies": { "request": "2.9.x" , "validator": "0.4.x" - , "express": "3" + , "express": "4" , "winston": "0.5.x" , "underscore": "1.3.1" , "sax": "0.3.x" From 25fcf4616461a0bd1c457a6e56848f885c25034d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1igo=20Beitia?= Date: Sun, 12 Oct 2014 17:18:17 +0700 Subject: [PATCH 2/4] Update index.js Updated to work with Express 4.0 --- notification_receptor/index.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/notification_receptor/index.js b/notification_receptor/index.js index 378b02d..d644968 100644 --- a/notification_receptor/index.js +++ b/notification_receptor/index.js @@ -1,27 +1,29 @@ -module.exports = function(config) { - var express = require('express') - , requestVerifier = require('./request_verifier')(config) - , requestHandler = require('./request_handler') - , ret; +module.exports = function (config) { + var express = require('express'), + requestVerifier = require('./request_verifier')(config), + requestHandler = require('./request_handler'), + errorhandler = require('errorhandler'), + ret; var receptor = express(); - receptor.use(receptor.router); - receptor.use(express.errorHandler({ dumpExceptions: true, showStack: true })); + //receptor.use(receptor.router); receptor.get('/', requestVerifier, requestHandler); + receptor.use(errorhandler({ dumpExceptions: true, showStack: true })); + ret = requestHandler.emitter; - ret.start = function(callback) { + ret.start = function (callback) { receptor.listen(config.receptor.port, config.receptor.host, callback); }; - ret.stop = function() { + ret.stop = function () { receptor.close(); }; ret.server = receptor; - + return ret; } From 0f5b29691f538e06a57a6bc79541d68eb1b74286 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1igo=20Beitia?= Date: Sun, 12 Oct 2014 17:19:06 +0700 Subject: [PATCH 3/4] Update package.json Errorhandler no longer packaged with Express. --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 0159089..813fb9c 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ , "winston": "0.5.x" , "underscore": "1.3.1" , "sax": "0.3.x" + , "errorhandler": "^1.0.2" } , "engines": { "node": ">=0.4.0" } , "devDependencies": { From fbc7d51d5e01581c6bc24ee01d812d4dc227ccc7 Mon Sep 17 00:00:00 2001 From: alantrrs Date: Wed, 22 Jul 2015 11:45:12 -0700 Subject: [PATCH 4/4] Fix typo --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 577d8bf..33888df 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ } , "engines": { "node": ">=0.4.0" } , "devDependencies": { - "nock": "*" + "nock": "*", "expresso": "*" } , "scripts": {