setting port via envvar is possible again

This commit is contained in:
Lendemor 2025-02-07 20:13:40 +01:00
parent d0f8fad0fc
commit 3f1c13b1ce
2 changed files with 12 additions and 2 deletions

View File

@ -544,6 +544,12 @@ class EnvironmentVariables:
# Whether to run the frontend only. Exclusive with REFLEX_BACKEND_ONLY.
REFLEX_FRONTEND_ONLY: EnvVar[bool] = env_var(False)
# The port to run the frontend on.
REFLEX_FRONTEND_PORT: EnvVar[int] = env_var(None)
# The port to run the backend on.
REFLEX_BACKEND_PORT: EnvVar[int] = env_var(None)
# Reflex internal env to reload the config.
RELOAD_CONFIG: EnvVar[bool] = env_var(False, internal=True)

View File

@ -289,10 +289,14 @@ def run(
envvar=environment.REFLEX_BACKEND_ONLY.name,
),
frontend_port: int = typer.Option(
config.frontend_port, help="Specify a different frontend port."
config.frontend_port,
help="Specify a different frontend port.",
envvar=environment.REFLEX_FRONTEND_PORT.name,
),
backend_port: int = typer.Option(
config.backend_port, help="Specify a different backend port."
config.backend_port,
help="Specify a different backend port.",
envvar=environment.REFLEX_BACKEND_PORT.name,
),
backend_host: str = typer.Option(
config.backend_host, help="Specify the backend host."