Remove self hosted check
This commit is contained in:
parent
c4af78cd00
commit
e68aea0307
|
@ -37,8 +37,8 @@ async function prepareUpload({ s3Key, bucket, metadata, file }) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function checkForSelfHostedURL(ctx) {
|
async function getAppIdFromUrl(ctx) {
|
||||||
// the "appId" component of the URL may actually be a specific self hosted URL
|
// the "appId" component of the URL can be the id or the custom url
|
||||||
let possibleAppUrl = `/${encodeURI(ctx.params.appId).toLowerCase()}`
|
let possibleAppUrl = `/${encodeURI(ctx.params.appId).toLowerCase()}`
|
||||||
const apps = await getDeployedApps()
|
const apps = await getDeployedApps()
|
||||||
if (apps[possibleAppUrl] && apps[possibleAppUrl].appId) {
|
if (apps[possibleAppUrl] && apps[possibleAppUrl].appId) {
|
||||||
|
@ -75,10 +75,7 @@ exports.uploadFile = async function (ctx) {
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.serveApp = async function (ctx) {
|
exports.serveApp = async function (ctx) {
|
||||||
let appId = ctx.params.appId
|
let appId = await getAppIdFromUrl(ctx)
|
||||||
if (env.SELF_HOSTED) {
|
|
||||||
appId = await checkForSelfHostedURL(ctx)
|
|
||||||
}
|
|
||||||
const App = require("./templates/BudibaseApp.svelte").default
|
const App = require("./templates/BudibaseApp.svelte").default
|
||||||
const db = new CouchDB(appId, { skip_setup: true })
|
const db = new CouchDB(appId, { skip_setup: true })
|
||||||
const appInfo = await db.get(DocumentTypes.APP_METADATA)
|
const appInfo = await db.get(DocumentTypes.APP_METADATA)
|
||||||
|
|
Loading…
Reference in New Issue