fix: serve uploaded images via /api/media/[name] to avoid Next.js static 404

This commit is contained in:
remco committed 2026-07-01 17:10:43 +02:00
1 parent 12576cc113
commit f2d13cf644
6 files changed
+44 -2

No files matched your search

+1 -1
View File
@@ -15,7 +15,7 @@ export async function GET() {
.filter((f) => /\.(png|jpg|jpeg|gif|webp|svg|bmp)$/i.test(f))
.map((f) => ({
name: f,
url: `/${MEDIA_DIR}/${f}`,
url: `/api/media/${f}`,
}))
.sort((a, b) => a.name.localeCompare(b.name));