Files
jaengseung-made/app/api/lotto/report/history/route.ts
gahusb 040866292e fix: 로또 API 504 타임아웃 및 Application error 수정
- _nas.ts: AbortSignal timeout 10s → 25s (NAS 무거운 연산 대응)
- stats/performance, report/latest, report/history: maxDuration = 60 추가 (Vercel 함수 타임아웃 연장)
- ReportTab: 에러 응답({error:"NAS_TIMEOUT"}) 받을 시 렌더 전 차단, confidence_factors null guard 추가
- PurchaseTab: API 에러 응답 감지 후 조용히 빈 상태 유지
- PatternTab: 에러 응답 감지 후 에러 메시지 표시

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-20 01:55:48 +09:00

16 lines
567 B
TypeScript

import { NextResponse } from 'next/server';
import { nasGet, requireSubscription, handleNasError } from '../../_nas';
export const maxDuration = 60;
export async function GET(request: Request) {
try {
const auth = await requireSubscription();
if (auth instanceof NextResponse) return auth;
const { searchParams } = new URL(request.url);
const limit = searchParams.get('limit') ?? '10';
const data = await nasGet(`/api/lotto/report/history?limit=${limit}`);
return NextResponse.json(data);
} catch (err) { return handleNasError(err); }
}