initial commit
This commit is contained in:
10
app/img/[...path]/route.ts
Normal file
10
app/img/[...path]/route.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { route } from "@/lib/http";
|
||||
import { servePublic } from "@/lib/files";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
/** Post bodies link images as /img/...; serve those from the site's public/
|
||||
* so absolute links resolve in the preview exactly as on the live site. */
|
||||
export const GET = route<{ params: Promise<{ path: string[] }> }>(async (_req, { params }) =>
|
||||
servePublic(["img", ...(await params).path])
|
||||
);
|
||||
Reference in New Issue
Block a user