mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-09 00:24:20 +01:00
Add Sentry hono middleware
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { Conf } from '@/config.ts';
|
||||
import '@/cron.ts';
|
||||
import { type User } from '@/db/users.ts';
|
||||
import {
|
||||
@@ -9,6 +10,7 @@ import {
|
||||
type HonoEnv,
|
||||
logger,
|
||||
type MiddlewareHandler,
|
||||
sentryMiddleware,
|
||||
serveStatic,
|
||||
} from '@/deps.ts';
|
||||
import '@/firehose.ts';
|
||||
@@ -81,6 +83,11 @@ type AppController = Handler<AppEnv>;
|
||||
|
||||
const app = new Hono<AppEnv>();
|
||||
|
||||
if (Conf.sentryDsn) {
|
||||
// @ts-ignore Mismatched hono types.
|
||||
app.use('*', sentryMiddleware({ dsn: Conf.sentryDsn }));
|
||||
}
|
||||
|
||||
app.use('*', logger());
|
||||
|
||||
app.get('/api/v1/streaming', streamingController);
|
||||
|
||||
@@ -6,8 +6,8 @@ export {
|
||||
Hono,
|
||||
HTTPException,
|
||||
type MiddlewareHandler,
|
||||
} from 'https://deno.land/x/hono@v3.3.4/mod.ts';
|
||||
export { cors, logger, serveStatic } from 'https://deno.land/x/hono@v3.3.4/middleware.ts';
|
||||
} from 'https://deno.land/x/hono@v3.7.5/mod.ts';
|
||||
export { cors, logger, serveStatic } from 'https://deno.land/x/hono@v3.7.5/middleware.ts';
|
||||
export { z } from 'https://deno.land/x/zod@v3.21.4/mod.ts';
|
||||
export { Author, RelayPool } from 'https://dev.jspm.io/nostr-relaypool@0.6.28';
|
||||
export {
|
||||
@@ -73,5 +73,6 @@ export { default as IpfsHash } from 'npm:ipfs-only-hash@^4.0.0';
|
||||
export { default as uuid62 } from 'npm:uuid62@^1.0.2';
|
||||
export { Machina } from 'https://gitlab.com/soapbox-pub/nostr-machina/-/raw/08a157d39f2741c9a3a4364cb97db36e71d8c03a/mod.ts';
|
||||
export * as Sentry from 'npm:@sentry/node@^7.73.0';
|
||||
export { sentry as sentryMiddleware } from 'npm:@hono/sentry@^1.0.0';
|
||||
|
||||
export type * as TypeFest from 'npm:type-fest@^4.3.0';
|
||||
|
||||
Reference in New Issue
Block a user