honojs-middleware/deno_dist/README.md

50 lines
1.0 KiB
Markdown
Raw Normal View History

2022-08-10 00:08:36 +08:00
# Sentry middleware for Hono
2022-08-04 07:54:30 +08:00
## Information
Sentry Middleware `@honojs/sentry` is renamed to `@hono/sentry`.
`@honojs/sentry` is not maintained, please use `@hono/sentry`.
Also, for Deno, you can use import with `npm:` prefix like `npm:@hono/sentry`.
---
2022-08-10 00:08:36 +08:00
Sentry middleware for [Hono](https://github.com/honojs/hono).
2022-08-22 23:14:46 +08:00
This middleware sends captured exceptions to the specified Sentry data source name via [toucan-js](https://github.com/robertcepa/toucan-js).
2022-08-04 07:54:30 +08:00
## Usage
```ts
import { sentry } from '@hono/sentry'
2022-08-04 07:54:30 +08:00
import { Hono } from 'hono'
const app = new Hono()
2022-08-10 00:08:36 +08:00
app.use('*', sentry())
2022-08-04 07:54:30 +08:00
app.get('/', (c) => c.text('foo'))
export default app
```
## Deno
```ts
import { serve } from 'https://deno.land/std/http/server.ts'
import { sentry } from 'npm:@hono/sentry'
2022-08-04 07:54:30 +08:00
import { Hono } from 'https://deno.land/x/hono/mod.ts'
const app = new Hono()
2022-08-12 11:41:03 +08:00
app.use('*', sentry({ dsn: 'https://xxxxxx@xxx.ingest.sentry.io/xxxxxx' }))
2022-08-04 07:54:30 +08:00
app.get('/', (c) => c.text('foo'))
serve(app.fetch)
```
## Author
2022-08-22 23:14:46 +08:00
Samuel Lippert <https://github.com/sam-lippert>
2022-08-04 07:54:30 +08:00
## License
MIT