tambahan
This commit is contained in:
@@ -10,9 +10,10 @@ import { convertOpenApiToMcp } from "./server/lib/mcp-converter";
|
|||||||
import UserRoute from "./server/routes/user_route";
|
import UserRoute from "./server/routes/user_route";
|
||||||
import LayananRoute from "./server/routes/layanan_route";
|
import LayananRoute from "./server/routes/layanan_route";
|
||||||
import AduanRoute from "./server/routes/aduan_route";
|
import AduanRoute from "./server/routes/aduan_route";
|
||||||
|
|
||||||
|
import { cors } from "@elysiajs/cors";
|
||||||
import { MCPRoute } from "./server/routes/mcp_route";
|
import { MCPRoute } from "./server/routes/mcp_route";
|
||||||
import PengaduanRoute from "./server/routes/pengaduan_route";
|
import PengaduanRoute from "./server/routes/pengaduan_route";
|
||||||
const PORT = process.env.PORT || 3000;
|
|
||||||
|
|
||||||
const Docs = new Elysia({
|
const Docs = new Elysia({
|
||||||
tags: ["docs"],
|
tags: ["docs"],
|
||||||
@@ -26,7 +27,6 @@ const Api = new Elysia({
|
|||||||
prefix: "/api",
|
prefix: "/api",
|
||||||
tags: ["api"],
|
tags: ["api"],
|
||||||
})
|
})
|
||||||
.use(Docs)
|
|
||||||
.use(apiAuth)
|
.use(apiAuth)
|
||||||
.use(ApiKeyRoute)
|
.use(ApiKeyRoute)
|
||||||
.use(DarmasabaRoute)
|
.use(DarmasabaRoute)
|
||||||
@@ -38,7 +38,7 @@ const Api = new Elysia({
|
|||||||
|
|
||||||
const app = new Elysia()
|
const app = new Elysia()
|
||||||
.use(Api)
|
.use(Api)
|
||||||
|
.use(Docs)
|
||||||
.use(Auth)
|
.use(Auth)
|
||||||
.get(
|
.get(
|
||||||
"/.well-known/mcp.json",
|
"/.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-Methods"] = "GET, POST, OPTIONS";
|
||||||
set.headers["Access-Control-Allow-Headers"] = "Content-Type";
|
set.headers["Access-Control-Allow-Headers"] = "Content-Type";
|
||||||
})
|
})
|
||||||
.listen(PORT, () => {
|
.listen(3000, () => {
|
||||||
console.log(`Server running at http://localhost:${PORT}`);
|
console.log("Server running at http://localhost:3000");
|
||||||
});
|
});
|
||||||
|
|
||||||
export type ServerApp = typeof app;
|
export type ServerApp = typeof app;
|
||||||
|
|||||||
Reference in New Issue
Block a user