16 lines
548 B
TypeScript
16 lines
548 B
TypeScript
import { readLocalServedFile } from "@/lib/server/storage";
|
|
|
|
export const runtime = "nodejs";
|
|
|
|
export async function GET(_request: Request, context: { params: Promise<{ path: string[] }> }) {
|
|
const { path } = await context.params;
|
|
const file = await readLocalServedFile("generated-results", path);
|
|
if (!file) return new Response("Not found", { status: 404 });
|
|
return new Response(new Uint8Array(file.bytes), {
|
|
headers: {
|
|
"Content-Type": file.contentType,
|
|
"Cache-Control": "public, max-age=31536000, immutable"
|
|
}
|
|
});
|
|
}
|