Lint and TRPC
This commit is contained in:
11
src/app/api/trpc/[trpc]/route.ts
Normal file
11
src/app/api/trpc/[trpc]/route.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { fetchRequestHandler } from '@trpc/server/adapters/fetch';
|
||||
import { createTRPCContext } from '@/trpc/init';
|
||||
import { appRouter } from '@/trpc/routers/_app';
|
||||
const handler = (req: Request): Promise<Response> =>
|
||||
fetchRequestHandler({
|
||||
endpoint: '/api/trpc',
|
||||
req,
|
||||
router: appRouter,
|
||||
createContext: createTRPCContext,
|
||||
});
|
||||
export { handler as GET, handler as POST };
|
||||
Reference in New Issue
Block a user