https://github.com/atatus/koa-atatus
Koa middleware to allow Atatus monitor Koa applications
https://github.com/atatus/koa-atatus
atatus koa middleware nodejs
Last synced: 2 months ago
JSON representation
Koa middleware to allow Atatus monitor Koa applications
- Host: GitHub
- URL: https://github.com/atatus/koa-atatus
- Owner: atatus
- Created: 2018-01-20T11:37:52.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-14T13:59:21.000Z (over 8 years ago)
- Last Synced: 2025-12-29T19:25:19.465Z (6 months ago)
- Topics: atatus, koa, middleware, nodejs
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# koa-atatus
Koa middleware to allow Atatus monitor **Koa 2.x** applications like Express.
## Installation
```
npm install koa-atatus
```
## API
You must add the koa-atatus middleware to every koa router instance before defining the routes.
```javascript
const atatus = require("atatus-node");
atatus.start({
apiKey: 'YOUR_API_KEY',
});
const koaAtatus = require('koa-atatus')(atatus);
const Koa = require('koa'),
Router = require('koa-router');
const app = new Koa();
const router = new Router();
router.use(koaAtatus); // This line should be added for every router instance.
// Routes
router.get('/', async function (next) {...});
// For error capturing
app.on('error', (err, ctx) => {
atatus.notifyError(err);
});
app.use(router.routes());
app.listen(3000);
```
## License
Copyright (c) 2018 Atatus
Licensed under the MIT license.