mirror of
https://github.com/hamster1963/nezha-dash.git
synced 2025-04-24 21:10:45 +08:00
18 lines
440 B
TypeScript
18 lines
440 B
TypeScript
import { GetNezhaData } from "@/lib/serverFetch";
|
|
import { NextResponse } from "next/server";
|
|
|
|
export const dynamic = "force-dynamic";
|
|
|
|
export async function GET(_: Request) {
|
|
try {
|
|
const response = await GetNezhaData();
|
|
return NextResponse.json(response, { status: 200 });
|
|
} catch (error) {
|
|
console.error(error);
|
|
return NextResponse.json(
|
|
{ error: "fetch nezha data failed" },
|
|
{ status: 400 },
|
|
);
|
|
}
|
|
}
|