diff --git a/api/src/base.ts b/api/src/base.ts index b4e285ef..5a24d0e4 100644 --- a/api/src/base.ts +++ b/api/src/base.ts @@ -55,7 +55,7 @@ export const base = new Elysia({ name: "base" }) .as("plugin"); export const prefix = process.env.KYOO_PREFIX ?? ""; -export const app = new Elysia({ prefix }) +export const handlers = new Elysia({ prefix }) .use(base) .use(auth) .guard( diff --git a/api/src/index.ts b/api/src/index.ts index 1769ddaf..3eeb325f 100644 --- a/api/src/index.ts +++ b/api/src/index.ts @@ -1,6 +1,6 @@ import { swagger } from "@elysiajs/swagger"; import Elysia from "elysia"; -import { app } from "./base"; +import { handlers } from "./base"; import { processImages } from "./controllers/seed/images"; import { migrate } from "./db"; import { comment } from "./utils"; @@ -10,7 +10,7 @@ await migrate(); // run image processor task in background processImages(); -new Elysia() +const app = new Elysia() .use( swagger({ scalarConfig: { @@ -83,7 +83,7 @@ new Elysia() }, }), ) - .use(app) + .use(handlers) .listen(3567); console.log(`Api running at ${app.server?.hostname}:${app.server?.port}`);