0.1.1 • Published 7 years ago
dingtalk-express-middleware v0.1.1
dingtalk-express-middleware
An express error middleware that will send error alert to Dingtalk bot.
Install
$ npm install dingtalk-express-middleware
How to use
All you need is a dingBot url. You should put this middleware before your last error handler.
const dingTalkExpress = require('dingtalk-express-middleware');
app.use(dingTalkExpress({
name: 'Your app name',
botUrl: 'Your dingbot url'
}));
Note
- If you try catch your err in route handler, you should throw it out
- This middleware should put before your last error handler
- If your error object has status attribute and it's not 500, it will not send to dingBot
When an error is catched by the middleware you will got an alert.