pcconfig.py supports a separate backend_port from api_url (#593)
This commit is contained in:
parent
387bacff73
commit
8f9b066794
@ -18,6 +18,9 @@ class Config(Base):
|
||||
# The frontend port.
|
||||
port: str = constants.FRONTEND_PORT
|
||||
|
||||
# The frontend port.
|
||||
backend_port: str = constants.BACKEND_PORT
|
||||
|
||||
# The backend API url.
|
||||
api_url: str = constants.API_URL
|
||||
|
||||
|
@ -65,6 +65,8 @@ PCVERSION_APP_FILE = os.path.join(WEB_DIR, "pynecone.json")
|
||||
# Commands to run the app.
|
||||
# The frontend default port.
|
||||
FRONTEND_PORT = "3000"
|
||||
# The backend default port.
|
||||
BACKEND_PORT = "8000"
|
||||
# The backend api url.
|
||||
API_URL = "http://localhost:8000"
|
||||
# The default path where bun is installed.
|
||||
|
@ -70,7 +70,7 @@ def run(
|
||||
):
|
||||
"""Run the app in the current directory."""
|
||||
frontend_port = utils.get_config().port if port is None else port
|
||||
backend_port = utils.get_api_port()
|
||||
backend_port = utils.get_config().backend_port
|
||||
|
||||
# If something is running on the ports, ask the user if they want to kill or change it.
|
||||
if utils.is_process_on_port(frontend_port):
|
||||
|
Loading…
Reference in New Issue
Block a user