Skip to content

Commit 65c83ac

Browse files
committed
fix: heatlh api
1 parent 079b990 commit 65c83ac

File tree

4 files changed

+3
-27
lines changed

4 files changed

+3
-27
lines changed

apps/api/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { fetchRequestHandler } from '@trpc/server/adapters/fetch';
66
import { autumnHandler } from 'autumn-js/elysia';
77
import { Elysia } from 'elysia';
88
import { logger } from './lib/logger';
9+
import { websiteAuth } from './middleware/website-auth';
910
import { assistant } from './routes/assistant';
1011
import { health } from './routes/health';
1112
import { query } from './routes/query';
@@ -40,7 +41,6 @@ const app = new Elysia()
4041
},
4142
})
4243
)
43-
4444
.use(query)
4545
.use(assistant)
4646
.all('/trpc/*', ({ request }) => {

apps/api/src/middleware/website-auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function json(status: number, body: unknown) {
1616

1717
export function websiteAuth() {
1818
return new Elysia()
19-
.onRequest(async ({ request }) => {
19+
.onBeforeHandle(async ({ request }) => {
2020
if (isPreflight(request)) {
2121
return;
2222
}

apps/api/src/routes/health.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const checkRedis = async () => {
3535
}
3636
};
3737

38-
export const health = new Elysia({ prefix: '/health' }).get('/', async () => {
38+
export const health = new Elysia().get('/health', async () => {
3939
const [clickhouse, database, redis] = await Promise.all([
4040
checkClickhouse(),
4141
checkDatabase(),

witcq

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)