Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
normalize request param of route handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
syhner committed Nov 29, 2023
1 parent 05f200e commit 8cb404b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/app/api/trpc/[trpc]/route.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { NextRequest } from 'next/server';
import { fetchRequestHandler } from '@trpc/server/adapters/fetch';
import { createContext } from '~/trpc/init';
import { appRouter } from '~/trpc/router';

const handler = (req: Request) =>
const handler = (request: NextRequest) =>
fetchRequestHandler({
endpoint: '/api/trpc',
req,
req: request,
router: appRouter,
createContext,
});
Expand Down

0 comments on commit 8cb404b

Please sign in to comment.