mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 07:38:33 -06:00
moving to trpc
This commit is contained in:
14
nextjs/src/app/api/trpc/[trpc]/route.ts
Normal file
14
nextjs/src/app/api/trpc/[trpc]/route.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { createContext } from "@/services/trpc/context";
|
||||
import { appRouter } from "@/services/trpc/router/app";
|
||||
import { fetchRequestHandler } from "@trpc/server/adapters/fetch";
|
||||
|
||||
const handler = (request: Request) => {
|
||||
return fetchRequestHandler({
|
||||
endpoint: "/api/trpc",
|
||||
req: request,
|
||||
router: appRouter,
|
||||
createContext: createContext,
|
||||
});
|
||||
};
|
||||
|
||||
export { handler as GET, handler as POST };
|
||||
Reference in New Issue
Block a user