Files
gitlab-instance-0a899031_cn…/app/api/geo/china/route.ts
2026-03-09 05:07:59 -05:00

21 lines
489 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 { NextResponse } from "next/server";
/**
* 代理中国地图 GeoJSON,避免前端 CORS
*/
export async function GET() {
try {
const res = await fetch(
"https://geo.datav.aliyun.com/areas_v3/bound/100000_full.json"
);
const data = await res.json();
return NextResponse.json(data);
} catch (e) {
console.error("Failed to fetch china map:", e);
return NextResponse.json(
{ error: "Failed to load map" },
{ status: 500 }
);
}
}