tRPC Endpoint를 /api/trpc로 변경

This commit is contained in:
static
2025-12-25 20:22:58 +09:00
parent 208252f6b2
commit a08ddf2c09
3 changed files with 4 additions and 4 deletions

View File

@@ -0,0 +1,15 @@
import { fetchRequestHandler } from "@trpc/server/adapters/fetch";
import { createContext } from "$trpc/init.server";
import { appRouter } from "$trpc/router.server";
import type { RequestHandler } from "./$types";
const trpcHandler: RequestHandler = (event) =>
fetchRequestHandler({
endpoint: "/api/trpc",
req: event.request,
router: appRouter,
createContext: () => createContext(event),
});
export const GET = trpcHandler;
export const POST = trpcHandler;