import fs from 'node:fs';
import path from 'node:path';
import { REPORTS_DIR } from '@/lib/paths.js';
export const runtime='nodejs'; export const dynamic='force-dynamic';
export async function GET(_req,{params}){ const file=path.basename((await params).file); const full=path.join(REPORTS_DIR,file); if(!full.startsWith(REPORTS_DIR)||!fs.existsSync(full)) return Response.json({error:'not found'},{status:404}); return new Response(fs.readFileSync(full,'utf8'),{headers:{'content-type':'text/markdown; charset=utf-8'}});}
