mirror of
https://github.com/caty21/forex-dashboard.git
synced 2026-08-17 22:48:06 +00:00
fix: rate-probabilities → European region + stronger browser headers
- preferredRegion: fra1/lhr1/cdg1 to bypass US cloud IP blocks on rateprobability.com - Better sec-* headers to pass bot detection (same-origin cors mode) - cache: no-store on fetch to avoid stale null caching - Log CB count on each invocation for diagnostics Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
5cf5d76601
commit
67c1811c8f
@@ -3,6 +3,7 @@ import { fetchAllCBPaths } from "@/lib/rateprobability";
|
||||
import type { RateProbData } from "@/lib/rateprobability";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
export const preferredRegion = ["fra1", "lhr1", "cdg1"]; // Europe (Frankfurt / London / Paris)
|
||||
|
||||
export type { RateProbData, CBRatePath, RateProbMeeting } from "@/lib/rateprobability";
|
||||
|
||||
@@ -13,8 +14,10 @@ export interface RateProbabilitiesResponse {
|
||||
|
||||
export async function GET() {
|
||||
const data = await fetchAllCBPaths();
|
||||
const currencies = Object.keys(data);
|
||||
console.log(`[rate-prob] fetched ${currencies.length} CBs: ${currencies.join(", ")}`);
|
||||
return NextResponse.json(
|
||||
{ data, fetchedAt: new Date().toISOString() } satisfies RateProbabilitiesResponse,
|
||||
{ headers: { "Cache-Control": "s-maxage=3600, stale-while-revalidate=7200" } }
|
||||
{ headers: { "Cache-Control": "no-store" } }
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user