1
0
Fork 0
mirror of synced 2024-06-30 20:10:54 +12:00

Fixing a minor issue with self hosting deployment/app creation.

This commit is contained in:
mike12345567 2021-02-09 17:43:22 +00:00 committed by Martin McKeaveney
parent dda087f10a
commit 43dd070c09

View file

@ -94,17 +94,22 @@ exports.getDeployedApps = async () => {
}
const workerUrl = !env.CLOUD ? await exports.getWorkerUrl() : env.WORKER_URL
const hostingKey = !env.CLOUD ? hostingInfo.selfHostKey : env.HOSTING_KEY
const response = await fetch(`${workerUrl}/api/apps`, {
method: "GET",
headers: {
"x-budibase-auth": hostingKey,
},
})
const json = await response.json()
for (let value of Object.values(json)) {
if (value.url) {
value.url = value.url.toLowerCase()
try {
const response = await fetch(`${workerUrl}/api/apps`, {
method: "GET",
headers: {
"x-budibase-auth": hostingKey,
},
})
const json = await response.json()
for (let value of Object.values(json)) {
if (value.url) {
value.url = value.url.toLowerCase()
}
}
return json
} catch (err) {
// error, cannot determine deployed apps, don't stop app creation - sort this later
return {}
}
return json
}