@base44-preview/cli 0.0.31-pr.226.0073f61 → 0.0.31-pr.226.1c102d7

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 CHANGED
@@ -195942,21 +195942,22 @@ var import_cors = __toESM(require_lib4(), 1);
195942
195942
  var import_express = __toESM(require_express(), 1);
195943
195943
  var import_http_proxy_middleware = __toESM(require_dist2(), 1);
195944
195944
  var DEFAULT_PORT = 3000;
195945
+ var BASE44_APP_URL = "https://base44.app";
195945
195946
  async function createDevServer() {
195946
195947
  const port = DEFAULT_PORT;
195947
195948
  const app = import_express.default();
195948
195949
  const remoteProxy = import_http_proxy_middleware.createProxyMiddleware({
195949
- target: "https://base44.app",
195950
+ target: BASE44_APP_URL,
195950
195951
  changeOrigin: true
195951
195952
  });
195952
195953
  app.use(import_cors.default({
195953
195954
  origin: /^http:\/\/localhost(:\d+)?$/,
195954
195955
  credentials: true
195955
195956
  }));
195956
- const AUTH_LOGIN_PATTERN = /^\/api\/apps\/auth(\/\w+)?\/login/;
195957
+ const AUTH_ROUTE_PATTERN = /^\/api\/apps\/auth(\/|$)/;
195957
195958
  app.use((req, res, next) => {
195958
- if (AUTH_LOGIN_PATTERN.test(req.path)) {
195959
- const targetUrl = `https://base44.app${req.originalUrl}`;
195959
+ if (AUTH_ROUTE_PATTERN.test(req.path)) {
195960
+ const targetUrl = `${BASE44_APP_URL}${req.originalUrl}`;
195960
195961
  return res.redirect(targetUrl);
195961
195962
  }
195962
195963
  next();
@@ -195964,17 +195965,13 @@ async function createDevServer() {
195964
195965
  app.use((req, res, next) => {
195965
195966
  return remoteProxy(req, res, next);
195966
195967
  });
195967
- return new Promise((resolve5, reject) => {
195968
+ return new Promise((resolve5) => {
195968
195969
  const server = app.listen(port, "127.0.0.1", () => {
195969
195970
  resolve5({
195970
195971
  port,
195971
195972
  server
195972
195973
  });
195973
195974
  });
195974
- server.on("error", (err) => {
195975
- server.close();
195976
- reject(err);
195977
- });
195978
195975
  });
195979
195976
  }
195980
195977
 
@@ -196102,7 +196099,7 @@ function createProgram(context) {
196102
196099
  program2.addCommand(getFunctionsDeployCommand(context));
196103
196100
  program2.addCommand(getSiteCommand(context));
196104
196101
  program2.addCommand(getTypesCommand(context), { hidden: true });
196105
- program2.addCommand(getDevCommand(context));
196102
+ program2.addCommand(getDevCommand(context), { hidden: true });
196106
196103
  return program2;
196107
196104
  }
196108
196105
 
@@ -200369,4 +200366,4 @@ export {
200369
200366
  CLIExitError
200370
200367
  };
200371
200368
 
200372
- //# debugId=56BAF5E09D48D65064756E2164756E21
200369
+ //# debugId=59FC856B7277C9C164756E2164756E21