Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

549 B
Raw Blame
import { document } from "@/lib/openapi";
import { getMcpDocument } from "@/lib/openapi/mcp-document";
import { NextRequest, NextResponse } from "next/server";

export function GET(req: NextRequest) {
  const isMcp = req.nextUrl.searchParams.has("mcp");
  const openapiDocument = isMcp ? getMcpDocument() : document;

  return NextResponse.json(openapiDocument, {
    headers: {
      // cache indefinitely till next deployment
      "Vercel-CDN-Cache-Control": "s-maxage=31536000",
      "Cache-Control": "public, max-age=31536000",
    },
  });
}