Add Toucan boilerplate
parent
2222f73280
commit
f7c2dfdbb3
12
src/index.ts
12
src/index.ts
|
@ -1,7 +1,19 @@
|
||||||
import type { Handler } from 'hono'
|
import type { Handler } from 'hono'
|
||||||
|
import Toucan from 'toucan-js'
|
||||||
|
|
||||||
export const hello = (): Handler => {
|
export const hello = (): Handler => {
|
||||||
return async (c, next) => {
|
return async (c, next) => {
|
||||||
|
const sentry = new Toucan({
|
||||||
|
dsn: c.env.SENTRY_DSN,
|
||||||
|
request: c.req,
|
||||||
|
allowedHeaders: ['user-agent'],
|
||||||
|
allowedSearchParams: /(.*)/,
|
||||||
|
})
|
||||||
|
|
||||||
|
try {
|
||||||
await next()
|
await next()
|
||||||
|
} catch (error) {
|
||||||
|
sentry.captureException(error)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue