2026-01-25 22:19:05 +00:00
|
|
|
import { trpcServer } from "@hono/trpc-server"
|
2026-01-25 14:54:08 +00:00
|
|
|
import { Hono } from "hono"
|
|
|
|
|
|
2026-01-25 16:21:00 +00:00
|
|
|
import { registerAuthHandlers } from "./auth/http.ts"
|
2026-01-25 22:19:05 +00:00
|
|
|
import { createContext } from "./trpc/context.ts"
|
|
|
|
|
import { appRouter } from "./trpc/router.ts"
|
2026-01-25 16:21:00 +00:00
|
|
|
|
2026-01-25 14:54:08 +00:00
|
|
|
const app = new Hono()
|
|
|
|
|
|
|
|
|
|
app.get("/health", (c) => c.json({ status: "ok" }))
|
|
|
|
|
|
2026-01-25 16:21:00 +00:00
|
|
|
registerAuthHandlers(app)
|
|
|
|
|
|
2026-01-25 22:19:05 +00:00
|
|
|
app.use(
|
|
|
|
|
"/trpc/*",
|
|
|
|
|
trpcServer({
|
|
|
|
|
router: appRouter,
|
|
|
|
|
createContext,
|
|
|
|
|
}),
|
|
|
|
|
)
|
|
|
|
|
|
2026-01-25 14:54:08 +00:00
|
|
|
export default {
|
|
|
|
|
port: 3000,
|
|
|
|
|
fetch: app.fetch,
|
|
|
|
|
}
|