Gate analytics and cache public API requests

This commit is contained in:
2569718930@qq.com
2026-04-06 13:58:11 +08:00
parent 9be12ad1d7
commit 08d7308486
14 changed files with 114 additions and 309 deletions
@@ -5,8 +5,14 @@ import {
} from "@/lib/backend-auth";
const API_BASE = process.env.POLYWEATHER_API_BASE_URL;
const ANALYTICS_ENABLED =
process.env.NEXT_PUBLIC_POLYWEATHER_APP_ANALYTICS === "true";
export async function POST(req: NextRequest) {
if (!ANALYTICS_ENABLED) {
return new NextResponse(null, { status: 204 });
}
if (!API_BASE) {
return NextResponse.json(
{ error: "POLYWEATHER_API_BASE_URL is not configured" },