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; } diff --git a/package.json b/package.json index 3f015f2..33888df 100644 --- a/package.json +++ b/package.json @@ -17,23 +17,22 @@ { "name": "Micah Silverman" } - ], - "dependencies": { - "request": "2.49.0", - "validator": "0.4.x", - "express": "3", - "winston": "0.8.3", - "underscore": "1.7.0", - "sax": "0.6.1" - }, - "engines": { - "node": ">=0.4.0" - }, - "devDependencies": { - "nock": "*", - "expresso": "*" - }, - "scripts": { + ] + , "dependencies": { + "request": "2.9.x" + , "validator": "0.4.x" + , "express": "4" + , "winston": "0.5.x" + , "underscore": "1.3.1" + , "sax": "0.3.x" + , "errorhandler": "^1.0.2" + } + , "engines": { "node": ">=0.4.0" } + , "devDependencies": { + "nock": "*", + "expresso": "*" + } + , "scripts": { "test": "make" }, "tags": [