chart-based route finding
This commit is contained in:
@@ -1,5 +1,17 @@
|
||||
const versionPromise = fetch('/version.json').then(async (response)=>await response.json())
|
||||
const metadataPromise = fetch('/metadata.json').then(async (response)=>await response.json())
|
||||
function _json(name) {
|
||||
return async function(response) {
|
||||
try {
|
||||
return await response.json()
|
||||
}
|
||||
catch (e) {
|
||||
console.error(`could not read ${name}`)
|
||||
return null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const versionPromise = fetch('/version.json').then(_json('version.json'))
|
||||
const metadataPromise = fetch('/metadata.json').then(_json('metadata.json'))
|
||||
|
||||
export const version = await versionPromise
|
||||
console.log('version', version)
|
||||
|
||||
Reference in New Issue
Block a user