mirror of
https://github.com/TheRealOwenRees/echecsfrance.git
synced 2026-07-23 12:36:57 +00:00
Reorganise code - use src folder
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import {
|
||||
FetchCreateContextFnOptions,
|
||||
fetchRequestHandler,
|
||||
} from "@trpc/server/adapters/fetch";
|
||||
|
||||
import { appRouter } from "@/server/appRouter";
|
||||
|
||||
const handler = (request: Request) => {
|
||||
return fetchRequestHandler({
|
||||
endpoint: "/api/trpc",
|
||||
req: request,
|
||||
router: appRouter,
|
||||
createContext: function (
|
||||
opts: FetchCreateContextFnOptions,
|
||||
): object | Promise<object> {
|
||||
return {};
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
export { handler as GET, handler as POST };
|
||||
Reference in New Issue
Block a user