Use demo app for reflex demo command (#2048)
This commit is contained in:
parent
f5e9debe4f
commit
804f55dbf2
@ -123,7 +123,7 @@ def init(
|
|||||||
|
|
||||||
|
|
||||||
def _run(
|
def _run(
|
||||||
env: constants.Env,
|
env: constants.Env = constants.Env.DEV,
|
||||||
frontend: bool = True,
|
frontend: bool = True,
|
||||||
backend: bool = True,
|
backend: bool = True,
|
||||||
frontend_port: str = str(get_config().frontend_port),
|
frontend_port: str = str(get_config().frontend_port),
|
||||||
@ -165,6 +165,9 @@ def _run(
|
|||||||
if backend_port != str(config.backend_port):
|
if backend_port != str(config.backend_port):
|
||||||
config._set_persistent(backend_port=backend_port)
|
config._set_persistent(backend_port=backend_port)
|
||||||
|
|
||||||
|
# Reload the config to make sure the env vars are persistent.
|
||||||
|
get_config(reload=True)
|
||||||
|
|
||||||
console.rule("[bold]Starting Reflex App")
|
console.rule("[bold]Starting Reflex App")
|
||||||
|
|
||||||
if frontend:
|
if frontend:
|
||||||
@ -711,17 +714,13 @@ def demo(
|
|||||||
os.chdir(tmp_dir)
|
os.chdir(tmp_dir)
|
||||||
_init(
|
_init(
|
||||||
name="reflex_demo",
|
name="reflex_demo",
|
||||||
template=constants.Templates.Kind.BASE,
|
template=constants.Templates.Kind.DEMO,
|
||||||
loglevel=constants.LogLevel.ERROR,
|
loglevel=constants.LogLevel.DEBUG,
|
||||||
)
|
)
|
||||||
_run(
|
_run(
|
||||||
env=constants.Env.DEV,
|
|
||||||
frontend=True,
|
|
||||||
backend=True,
|
|
||||||
frontend_port=frontend_port,
|
frontend_port=frontend_port,
|
||||||
backend_port=backend_port,
|
backend_port=backend_port,
|
||||||
backend_host="localhost",
|
loglevel=constants.LogLevel.DEBUG,
|
||||||
loglevel=constants.LogLevel.ERROR,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user