From 2ecba2c65278cfa2fe2296333651aeeaea2750bf Mon Sep 17 00:00:00 2001 From: rtritto Date: Tue, 8 Oct 2024 20:05:32 +0200 Subject: [PATCH] fix: compile once --- src/index.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index a27058f..94e3e7f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -40,15 +40,14 @@ const toResponse = async (res: HttpResponse, response: Response) => { export const node = (port: number, callback: (socket: us_listen_socket) => any = () => {}) => (app: Elysia) => { + app.compile() + // @ts-ignore const routes: InternalRoute[] = app.routes const server = App() for (const { method, path, composed: handle } of routes) { - // @ts-ignore - app.compile() - const ids = path .split('/') .filter((name) => name.startsWith(':'))