Files
aris/apps/aris-backend/src/server.ts
kenneth aff9464245 feat(backend): add tRPC with Hono adapter
- Add @trpc/server, @hono/trpc-server, zod dependencies
- Create tRPC context with BetterAuth session
- Create router with publicProcedure and protectedProcedure
- Mount tRPC at /trpc/* via Hono adapter

Co-authored-by: Ona <no-reply@ona.com>
2026-01-25 22:19:05 +00:00

26 lines
462 B
TypeScript

import { trpcServer } from "@hono/trpc-server"
import { Hono } from "hono"
import { registerAuthHandlers } from "./auth/http.ts"
import { createContext } from "./trpc/context.ts"
import { appRouter } from "./trpc/router.ts"
const app = new Hono()
app.get("/health", (c) => c.json({ status: "ok" }))
registerAuthHandlers(app)
app.use(
"/trpc/*",
trpcServer({
router: appRouter,
createContext,
}),
)
export default {
port: 3000,
fetch: app.fetch,
}