https://github.com/makerbot/error.flynn
Express middleware for posting errors to Slack
https://github.com/makerbot/error.flynn
nodejs npm-package slack web
Last synced: 5 months ago
JSON representation
Express middleware for posting errors to Slack
- Host: GitHub
- URL: https://github.com/makerbot/error.flynn
- Owner: makerbot
- Created: 2015-10-17T18:27:41.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-09-21T14:21:00.000Z (almost 9 years ago)
- Last Synced: 2025-10-26T02:18:32.437Z (8 months ago)
- Topics: nodejs, npm-package, slack, web
- Language: JavaScript
- Size: 237 KB
- Stars: 0
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://travis-ci.org/makerbot/error.flynn)
[](https://david-dm.org/makerbot/error.flynn)
### Install
```sh
npm install --save error.flynn
```
---
### Use
First, setup an Incoming Webhook in Slack `https://.slack.com/services/`
Then:
```js
const express = require('express')
, flynn = require('error.flynn')
, app = express()
;
app.get('/', (req, res, next) => {
next(new Error('Send me to Slack!'));
});
// Either set process.env.ERROR_FLYNN_URL or use the url as the first param for flynn)
app.use(flynn('https://hooks.slack.com/services/TOKEN'));
app.use((err, req, res, next) => {
res.sendStatus(500);
});
```
The last part (below the comment) could also be done more concisely:
```js
app.use(flynn('https://hooks.slack.com/services/TOKEN'), (err, req, res, next) => {
res.sendStatus(500);
});
```
---
### Tests
```sh
npm test
```
---
### Example Output
