mirror of
https://github.com/caty21/forex-dashboard.git
synced 2026-07-27 20:37:45 +00:00
886a5b426f
- Add export const dynamic = "force-dynamic" to routes previously pre-rendered as static (rate-probabilities, news, fx, yields, calendar) → fixes empty data on Vercel where static pre-render got HTTP 403 - Add PWA: manifest.json, sw.js, icons, layout meta + apple-touch-icon Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
21 lines
662 B
TypeScript
21 lines
662 B
TypeScript
import { NextResponse } from "next/server";
|
|
import { fetchAllCBPaths } from "@/lib/rateprobability";
|
|
import type { RateProbData } from "@/lib/rateprobability";
|
|
|
|
export const dynamic = "force-dynamic";
|
|
|
|
export type { RateProbData, CBRatePath, RateProbMeeting } from "@/lib/rateprobability";
|
|
|
|
export interface RateProbabilitiesResponse {
|
|
data: RateProbData;
|
|
fetchedAt: string;
|
|
}
|
|
|
|
export async function GET() {
|
|
const data = await fetchAllCBPaths();
|
|
return NextResponse.json(
|
|
{ data, fetchedAt: new Date().toISOString() } satisfies RateProbabilitiesResponse,
|
|
{ headers: { "Cache-Control": "s-maxage=3600, stale-while-revalidate=7200" } }
|
|
);
|
|
}
|