Skip to content

Commit 1e79561

Browse files
fix: code rabbit ai review comments
1 parent edf0f1c commit 1e79561

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/server/src/elysia/handler.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ export function createElysiaHandler(options: ElysiaOptions) {
2727
const requestHandler = options.handler ?? RPCApiHandler();
2828

2929
return async (app: Elysia) => {
30-
app.all('/*', async ({ request, body, set }: ElysiaContext) => {
31-
const prisma = (await options.getPrisma({ request, body, set } as ElysiaContext)) as DbClientContract;
30+
app.all('/*', async (ctx: ElysiaContext) => {
31+
const { request, body, set } = ctx;
32+
const prisma = (await options.getPrisma(ctx)) as DbClientContract;
3233
if (!prisma) {
3334
set.status = 500;
3435
return {
@@ -47,7 +48,7 @@ export function createElysiaHandler(options: ElysiaOptions) {
4748
}
4849
}
4950

50-
if (!path) {
51+
if (!path || path === '/') {
5152
set.status = 400;
5253
return {
5354
message: 'missing path parameter',

0 commit comments

Comments
 (0)