express-errors-to-slack
NodeJS ExpressJS middleware that Sends all your express errors/exceptions to Slack channel via Slack webhooks (which may be rate limited by slack server) or via Slack API
Installation
npm install express-errors-to-slack
Example usage with Slack API
Replace <SLACK_API_TOKEN> with API Token obtained from https://api.slack.com/tokens
'use strict'; const express = ;const slackErrors = ; const app = ; // Route that triggers a errorapp; // Send error reporting to Slackapp;app;
Example usage with Slack Webhook
Replace <SLACK_WEBHOOK_URL> with your incoming webhook url obtained from https://api.slack.com/slack-apps
But remember slack servers limit rate if your logs exceed 1 message per second. API usage preffered
'use strict'; const express = ;const slackErrors = ; const app = ; // Route that triggers a errorapp; // Send error reporting to Slackapp;app;