feat: servir arquivos do MinIO via API interna
This commit is contained in:
@@ -20,11 +20,9 @@ export async function POST(request: Request) {
|
||||
'Content-Type': file.type,
|
||||
});
|
||||
|
||||
// Construct public URL
|
||||
// In a real production env, this should be an env var like NEXT_PUBLIC_STORAGE_URL
|
||||
const url = `http://localhost:9000/${bucketName}/${filename}`;
|
||||
const url = `/api/files/${filename}`;
|
||||
|
||||
return NextResponse.json({ url });
|
||||
return NextResponse.json({ url, path: filename });
|
||||
} catch (error) {
|
||||
console.error('Upload error:', error);
|
||||
return NextResponse.json({ error: 'Error uploading file' }, { status: 500 });
|
||||
|
||||
Reference in New Issue
Block a user