{ "html": "
\n

Installation

\n

Raven is distributed via npm:

\n
$ npm install raven --save\n
\n
\n
\n\n\n
\n

Connect

\n
var connect = require('connect');\nvar Raven = require('raven');\n\n// Must configure Raven before doing anything else with it\nRaven.config('___DSN___').install();\n\nfunction mainHandler(req, res) {\n    throw new Error('Broke!');\n}\n\nfunction onError(err, req, res, next) {\n    // The error id is attached to `res.sentry` to be returned\n    // and optionally displayed to the user for support.\n    res.statusCode = 500;\n    res.end(res.sentry + '\\n');\n}\n\nconnect(\n    // The request handler be the first item\n    Raven.requestHandler(),\n\n    connect.bodyParser(),\n    connect.cookieParser(),\n    mainHandler,\n\n    // The error handler must be before any other error middleware\n    Raven.errorHandler(),\n\n    // Optional fallthrough error handler\n    onError,\n).listen(3000);\n
\n
\n
\n", "link": "https://docs.getsentry.com/clients/node/integrations/connect/", "id": "node-connect", "name": "Connect" }