@base44-preview/cli 0.3.6-pr.704.4aaba3b → 0.3.6-pr.706.15dfd19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +8 -5
- package/dist/cli/index.js.map +5 -5
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -225957,6 +225957,10 @@ var DEFAULT_API_URL = "https://app.base44.com";
|
|
|
225957
225957
|
function getBase44ApiUrl() {
|
|
225958
225958
|
return process.env.BASE44_API_URL || DEFAULT_API_URL;
|
|
225959
225959
|
}
|
|
225960
|
+
function getAppsBackendUrl() {
|
|
225961
|
+
const apiUrl = getBase44ApiUrl();
|
|
225962
|
+
return apiUrl === DEFAULT_API_URL ? "https://base44.app" : apiUrl;
|
|
225963
|
+
}
|
|
225960
225964
|
function getTestOverrides() {
|
|
225961
225965
|
const raw = process.env.BASE44_CLI_TEST_OVERRIDES;
|
|
225962
225966
|
if (!raw) {
|
|
@@ -270977,7 +270981,6 @@ class WatchBase44 extends EventEmitter4 {
|
|
|
270977
270981
|
|
|
270978
270982
|
// src/cli/dev/dev-server/main.ts
|
|
270979
270983
|
var DEFAULT_PORT = 4400;
|
|
270980
|
-
var BASE44_APP_URL = "https://base44.app";
|
|
270981
270984
|
async function createDevServer(options) {
|
|
270982
270985
|
const { port: userPort } = options;
|
|
270983
270986
|
const port = userPort ?? await getPorts({
|
|
@@ -270987,7 +270990,7 @@ async function createDevServer(options) {
|
|
|
270987
270990
|
const { functions, entities, project, siteUrl } = await options.loadResources();
|
|
270988
270991
|
const app = import_express6.default();
|
|
270989
270992
|
const remoteProxy = import_http_proxy_middleware2.createProxyMiddleware({
|
|
270990
|
-
target:
|
|
270993
|
+
target: getAppsBackendUrl(),
|
|
270991
270994
|
changeOrigin: true
|
|
270992
270995
|
});
|
|
270993
270996
|
app.use(import_cors.default({
|
|
@@ -270997,7 +271000,7 @@ async function createDevServer(options) {
|
|
|
270997
271000
|
const AUTH_ROUTE_PATTERN = /^\/api\/apps\/auth(\/|$)/;
|
|
270998
271001
|
app.use((req, res, next) => {
|
|
270999
271002
|
if (AUTH_ROUTE_PATTERN.test(req.path)) {
|
|
271000
|
-
const targetUrl = new URL(req.originalUrl,
|
|
271003
|
+
const targetUrl = new URL(req.originalUrl, getAppsBackendUrl());
|
|
271001
271004
|
return res.redirect(targetUrl.toString());
|
|
271002
271005
|
}
|
|
271003
271006
|
next();
|
|
@@ -271304,7 +271307,7 @@ function inheritedEnv() {
|
|
|
271304
271307
|
}
|
|
271305
271308
|
return env;
|
|
271306
271309
|
}
|
|
271307
|
-
var appPreviewUrl = (appId) => `https://preview--${appId}.base44.app
|
|
271310
|
+
var appPreviewUrl = (appId) => getBase44ApiUrl() === DEFAULT_API_URL ? `https://preview--${appId}.base44.app` : getBase44ApiUrl();
|
|
271308
271311
|
async function resolveAppBaseUrl(appId) {
|
|
271309
271312
|
try {
|
|
271310
271313
|
return await getSiteUrl();
|
|
@@ -275660,4 +275663,4 @@ export {
|
|
|
275660
275663
|
runCLI
|
|
275661
275664
|
};
|
|
275662
275665
|
|
|
275663
|
-
//# debugId=
|
|
275666
|
+
//# debugId=D50299D36725282164756E2164756E21
|