mc-dashboard/app/api/mods/route.ts

19 lines
425 B
TypeScript
Raw Permalink Normal View History

import { NextResponse } from "next/server";
import { getModDetails } from "@/lib/mods";
export const dynamic = "force-dynamic";
export async function GET() {
try {
const mods = getModDetails();
return NextResponse.json(mods, {
headers: { "Cache-Control": "public, max-age=10" },
});
} catch (e) {
return NextResponse.json(
{ error: (e as Error).message },
{ status: 500 }
);
}
}