12 lines
244 B
JavaScript
12 lines
244 B
JavaScript
function getPath(path)
|
|
{
|
|
return fetch(path).then((response) => {
|
|
if (!response.ok) {
|
|
throw new Error(`${path}: ${response.status}`)
|
|
}
|
|
return response.blob()
|
|
}).then((blob) => { return blob.text() })
|
|
}
|
|
|
|
export { getPath };
|