diff options
Diffstat (limited to 'src/server/index.ts')
| -rw-r--r-- | src/server/index.ts | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/server/index.ts b/src/server/index.ts index 01a489f..d157f74 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -9,15 +9,17 @@ const app = new Hono(); app.use("*", logger()); app.onError(errorHandler); -app.get("/", (c) => { - return c.json({ message: "Kioku API" }); -}); - -app.get("/api/health", (c) => { - return c.json({ status: "ok" }); -}); - -app.route("/api/auth", auth); +// Chain routes for RPC type inference +const routes = app + .get("/", (c) => { + return c.json({ message: "Kioku API" }, 200); + }) + .get("/api/health", (c) => { + return c.json({ status: "ok" }, 200); + }) + .route("/api/auth", auth); + +export type AppType = typeof routes; const port = Number(process.env.PORT) || 3000; console.log(`Server is running on port ${port}`); |
