fix: serve uploaded images via /api/media/[name] to avoid Next.js static 404
This commit is contained in:
1 parent
12576cc113
commit
f2d13cf644
6 files changed
+44
-2
No files matched your search
@@ -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));
|
||||
|
||||
|
||||
Reference in new issue
Block a user