Initial commit

This commit is contained in:
admin
2026-05-26 22:46:00 +02:00
commit 7e2c2ff89c
256 changed files with 51523 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
import { NextRequest } from "next/server";
import { serveImage } from "@/lib/api/serveAssets";
export const runtime = "nodejs";
export async function GET(req: NextRequest, ctx: { params: Promise<{ file: string }> }) {
const { file } = await ctx.params;
const url = new URL(req.url);
const id = url.searchParams.get("id");
const codeFromPath = decodeURIComponent(file).replace(/\.[^.]+$/, "");
// Don't try to look up by code when the path is the "image-<id>" fallback.
const code = codeFromPath.startsWith("image-") ? null : codeFromPath;
return serveImage(req, { id, code });
}