feat: Add API route to fetch cities from the backend.

This commit is contained in:
2569718930@qq.com
2026-03-12 00:40:28 +08:00
parent 294e038f57
commit a46a98f25e
+2 -1
View File
@@ -2,6 +2,7 @@ import { NextResponse } from "next/server";
import { buildBackendRequestHeaders } from "@/lib/backend-auth";
const API_BASE = process.env.POLYWEATHER_API_BASE_URL;
export const dynamic = "force-dynamic";
export async function GET() {
if (!API_BASE) {
@@ -14,7 +15,7 @@ export async function GET() {
try {
const res = await fetch(`${API_BASE}/api/cities`, {
headers: buildBackendRequestHeaders(),
next: { revalidate: 120 },
cache: "no-store",
});
if (!res.ok) {
const raw = await res.text();