dingtalk-express-middleware

0.1.1 • Public • Published

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

  1. If you try catch your err in route handler, you should throw it out
  2. This middleware should put before your last error handler
  3. 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.

Readme

Keywords

none

Package Sidebar

Install

npm i dingtalk-express-middleware

Weekly Downloads

1

Version

0.1.1

License

MIT

Last publish

Collaborators

  • pana