observatoire

This commit is contained in:
alma 2025-05-06 22:13:34 +02:00
parent 025040289b
commit 0a7cccb303

View File

@ -18,16 +18,19 @@ const s3Client = new S3Client({
// This endpoint serves mission images from Minio using the server's credentials
export async function GET(
request: NextRequest,
context: { params: { path: string[] } }
{ params }: { params: Promise<{ path: string[] }> }
) {
try {
// Await the params promise to get the actual path parameter
const { path } = await params
// Check if path is provided
if (!context.params.path || context.params.path.length === 0) {
if (!path || path.length === 0) {
return new NextResponse('Path is required', { status: 400 });
}
// Reconstruct the full path from path segments
const filePath = context.params.path.join('/');
const filePath = path.join('/');
console.log('Fetching mission image:', filePath);
// Create S3 command to get the object