1.0.0 • Published 2 years ago
coderr.client.expressjs v1.0.0
ExpressJS library for coderr.io
Coderr provides automated error reporting for ExpressJS-based applications.
this is a beta library, feel free to try it
Register an account at https://lobby.coderr.io
Installation
Download this package:
npm -I coderr.client.expressjs
Import both the Coderr base library and the expressjs package:
import { err } from "coderr.client";
import { activatePlugin, errorMiddleware } from "coderr.client.expressjs";
// in the top of your app.js/ts
err.configuration.credentials("https://report.coderr.io", "yourAppKey", "yourSharedSecret");
// To configure the expressJS plugin.
activatePlugin(err);
// As the last middleware:
app.use(errorMiddleware);
Reporting slow queries.
You can report slow queries and/or all pages that generate 403 (Forbidden).
Add the coderrMiddleware for that:
import * as coderr from "coderr.client.expressjs";
// Either use this to set a limit to all HTTP verbs (in milliseconds)
coderr.requestTimeThreshold = 200;
// or do it per verb:
coderr.requestMethodTimeThresholds['post'] = 200;
// As the *first* middleware:
app.use(coderr.coderrMiddleware);
Reporting forbidden requests
You can report all requests that generate 403 forbidden:
import * as coderr from "coderr.client.expressjs";
coderr.reportForbidden = true;
// As the *first* middleware:
app.use(coderr.coderrMiddleware);
Further reading
Start with our getting started guide:
1.0.0
2 years ago
1.0.0-rc01
2 years ago