flatten app to repo root and update docker deployment for single-stack runtime

This commit is contained in:
2026-02-24 00:25:03 -05:00
parent 2987ac06fa
commit 168c05cb71
59 changed files with 64 additions and 12 deletions

22
app/api/filings/route.ts Normal file
View File

@@ -0,0 +1,22 @@
import { getStoreSnapshot } from '@/lib/server/store';
export async function GET(request: Request) {
const url = new URL(request.url);
const tickerFilter = url.searchParams.get('ticker')?.trim().toUpperCase();
const limitValue = Number(url.searchParams.get('limit') ?? 50);
const limit = Number.isFinite(limitValue)
? Math.min(Math.max(Math.trunc(limitValue), 1), 250)
: 50;
const snapshot = await getStoreSnapshot();
const filtered = tickerFilter
? snapshot.filings.filter((filing) => filing.ticker === tickerFilter)
: snapshot.filings;
const filings = filtered
.slice()
.sort((a, b) => Date.parse(b.filing_date) - Date.parse(a.filing_date))
.slice(0, limit);
return Response.json({ filings });
}