Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/openstatusHQ/openstatus. 🫖 Status page with uptime monitoring & API monitoring as code 🫖 openstatus.dev
Something went wrong. Try again.
1234567891011121314151617181920212223242526import { appRouter, createTRPCContext } from "@openstatus/api";import { createTRPCOnError } from "@openstatus/api/src/trpc-errors";import { fetchRequestHandler } from "@trpc/server/adapters/fetch";import type { NextRequest } from "next/server";
import { guardTRPCSource } from "../../../../../trpc/shared";
// Runs on the Node.js runtime (Vercel Fluid compute). The whole tRPC surface// is served here — several routers pull Node-only deps (@slack/web-api, email// and notification SDKs) that are not Edge-safe.
const handler = (req: NextRequest) => { const blocked = guardTRPCSource(req); if (blocked) return blocked;
return fetchRequestHandler({ endpoint: "/api/trpc/lambda", router: appRouter, req: req, createContext: () => createTRPCContext({ req }), onError: createTRPCOnError("lambda"), });};
export { handler as GET, handler as POST };