3d-viewer/app/three/utils/get-metadata.ts
2025-02-26 09:46:13 +01:00

15 lines
337 B
TypeScript

export async function getMetadata(serviceUrl: string) {
const response = await fetch(serviceUrl, {
method: "GET",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
});
if (response.ok) {
return response.json();
} else {
throw new Error("HTTP error status: " + response.status);
}
}