mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 07:38:33 -06:00
moving v2 to top level
This commit is contained in:
16
src/app/api/trpc/[trpc]/route.ts
Normal file
16
src/app/api/trpc/[trpc]/route.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { createTrpcContext } from "@/services/serverFunctions/context";
|
||||
import { trpcAppRouter } from "@/services/serverFunctions/router/app";
|
||||
import { fetchRequestHandler } from "@trpc/server/adapters/fetch";
|
||||
|
||||
const handler = async (request: Request) => {
|
||||
|
||||
// await new Promise(r => setTimeout(r, 1000)); // delay for testing
|
||||
return fetchRequestHandler({
|
||||
endpoint: "/api/trpc",
|
||||
req: request,
|
||||
router: trpcAppRouter,
|
||||
createContext: createTrpcContext,
|
||||
});
|
||||
};
|
||||
|
||||
export { handler as GET, handler as POST };
|
||||
Reference in New Issue
Block a user