express-errors-handler
Some middleware for Express and Node that sets up Raven (or not as appropriate) depending on sensible environment variables.
Installation
npm install --save express-errors-handler
Usage
var express = ;var app = ;var eeh = var errorMiddleware = eehmiddleware; var promiseEnabledApi = ; // A typical route using Promisesapp; // A typical route with an upstream dependencyapp; // Make sure the middleware is added after your routes otherwise you'll lose the errorsapp;
Supported environment variables
NODE_ENV
- mode to operate in, can be eitherPRODUCTION
(sends bugs to aggregator) or any another value (shows bugs to user)RAVEN_URL
- URL to report bugs captured in productionSPLUNK_URL
- URL to send non critical or upstream bugs too
License
This software is published by the Financial Times under the MIT license.