Files

18 lines
490 B
TypeScript

import fs from "fs/promises";
import { NextResponse } from "next/server";
import { getWatermarkPath } from "@/lib/storage";
export async function GET() {
try {
const buf = await fs.readFile(getWatermarkPath());
return new NextResponse(buf, {
headers: {
"Content-Type": "image/png",
"Cache-Control": "public, max-age=86400, immutable",
},
});
} catch {
return NextResponse.json({ error: "Watermark asset not found" }, { status: 404 });
}
}