AEB-71: Added 3D navigation in monitoring zones

This commit is contained in:
iv_vuytsik
2025-11-11 10:07:38 +03:00
parent 549a05509b
commit 88653cb07c
27 changed files with 503 additions and 184 deletions

View File

@@ -17,11 +17,21 @@ export async function GET(
const stat = fs.statSync(filePath);
const stream = fs.createReadStream(filePath);
const ext = path.extname(fileName).toLowerCase();
let contentType = 'application/octet-stream';
if (ext === '.glb') contentType = 'model/gltf-binary';
else if (ext === '.gltf') contentType = 'model/gltf+json';
else if (ext === '.bin') contentType = 'application/octet-stream';
else if (ext === '.png') contentType = 'image/png';
else if (ext === '.jpg' || ext === '.jpeg') contentType = 'image/jpeg';
else if (ext === '.webp') contentType = 'image/webp';
else if (ext === '.ktx2') contentType = 'image/ktx2';
return new Response(stream as unknown as ReadableStream, {
headers: {
'Content-Length': stat.size.toString(),
'Content-Type': 'model/gltf-binary',
'Content-Type': contentType,
},
});
}