diff --git a/src/index.tsx b/src/index.tsx index a2131c9..dfb6f62 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -10,9 +10,10 @@ import { convertOpenApiToMcp } from "./server/lib/mcp-converter"; import UserRoute from "./server/routes/user_route"; import LayananRoute from "./server/routes/layanan_route"; import AduanRoute from "./server/routes/aduan_route"; + +import { cors } from "@elysiajs/cors"; import { MCPRoute } from "./server/routes/mcp_route"; import PengaduanRoute from "./server/routes/pengaduan_route"; -const PORT = process.env.PORT || 3000; const Docs = new Elysia({ tags: ["docs"], @@ -26,7 +27,6 @@ const Api = new Elysia({ prefix: "/api", tags: ["api"], }) - .use(Docs) .use(apiAuth) .use(ApiKeyRoute) .use(DarmasabaRoute) @@ -38,7 +38,7 @@ const Api = new Elysia({ const app = new Elysia() .use(Api) - + .use(Docs) .use(Auth) .get( "/.well-known/mcp.json", @@ -60,8 +60,8 @@ const app = new Elysia() set.headers["Access-Control-Allow-Methods"] = "GET, POST, OPTIONS"; set.headers["Access-Control-Allow-Headers"] = "Content-Type"; }) - .listen(PORT, () => { - console.log(`Server running at http://localhost:${PORT}`); + .listen(3000, () => { + console.log("Server running at http://localhost:3000"); }); export type ServerApp = typeof app;