|
@@ -4,7 +4,7 @@ from pathlib import Path
|
|
|
from typing import Optional
|
|
|
|
|
|
from reflex import constants
|
|
|
-from reflex.config import get_config
|
|
|
+from reflex.config import environment, get_config
|
|
|
from reflex.utils import build, console, exec, prerequisites, telemetry
|
|
|
|
|
|
config = get_config()
|
|
@@ -18,6 +18,7 @@ def export(
|
|
|
upload_db_file: bool = False,
|
|
|
api_url: Optional[str] = None,
|
|
|
deploy_url: Optional[str] = None,
|
|
|
+ env: constants.Env = constants.Env.PROD,
|
|
|
loglevel: constants.LogLevel = console._LOG_LEVEL,
|
|
|
):
|
|
|
"""Export the app to a zip file.
|
|
@@ -30,11 +31,15 @@ def export(
|
|
|
upload_db_file: Whether to upload the database file. Defaults to False.
|
|
|
api_url: The API URL to use. Defaults to None.
|
|
|
deploy_url: The deploy URL to use. Defaults to None.
|
|
|
+ env: The environment to use. Defaults to constants.Env.PROD.
|
|
|
loglevel: The log level to use. Defaults to console._LOG_LEVEL.
|
|
|
"""
|
|
|
# Set the log level.
|
|
|
console.set_log_level(loglevel)
|
|
|
|
|
|
+ # Set env mode in the environment
|
|
|
+ environment.REFLEX_ENV_MODE.set(env)
|
|
|
+
|
|
|
# Override the config url values if provided.
|
|
|
if api_url is not None:
|
|
|
config.api_url = str(api_url)
|