mirror of
https://github.com/enricoros/big-AGI.git
synced 2026-05-10 21:50:14 -07:00
886c4b411e
This reverts commit 8888fd40cd.
20 lines
814 B
TypeScript
20 lines
814 B
TypeScript
import { fetchRequestHandler } from '@trpc/server/adapters/fetch';
|
|
|
|
import { appRouterEdge } from '~/server/trpc/trpc.router-edge';
|
|
import { createTRPCFetchContext } from '~/server/trpc/trpc.server';
|
|
|
|
const handlerEdgeRoutes = (req: Request) => fetchRequestHandler({
|
|
endpoint: '/api/edge',
|
|
router: appRouterEdge,
|
|
req,
|
|
createContext: createTRPCFetchContext,
|
|
onError:
|
|
process.env.NODE_ENV === 'development'
|
|
? ({ path, error }) => console.error(`\n❌ tRPC-edge failed on ${path ?? 'unk-path'}: ${error.message}`)
|
|
: undefined,
|
|
});
|
|
|
|
// NOTE: we don't set maxDuration explicitly here - however we set it in the Vercel project settings, raising to the limit of 300s
|
|
// export const maxDuration = 60;
|
|
export const runtime = 'edge';
|
|
export { handlerEdgeRoutes as GET, handlerEdgeRoutes as POST }; |