Files
neta/app/.well-known/neta/route.ts
T

35 lines
866 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { getNetaDiscoveryDocument } from "@/server/api/v1/runtime";
export const runtime = "nodejs";
export const dynamic = "force-dynamic";
export function GET() {
try {
return Response.json(getNetaDiscoveryDocument(), {
headers: {
"Cache-Control": "public, max-age=60, stale-while-revalidate=300",
"X-Content-Type-Options": "nosniff",
},
});
} catch (error) {
console.error("Neta discovery failed", error);
return Response.json(
{
protocol: "neta",
discoveryVersion: 1,
error: {
code: "SERVICE_UNAVAILABLE",
message: "Instance keşif bilgisi geçici olarak kullanılamıyor.",
},
},
{
status: 503,
headers: {
"Cache-Control": "no-store",
"X-Content-Type-Options": "nosniff",
},
},
);
}
}