diff --git a/src/backend/langflow/__main__.py b/src/backend/langflow/__main__.py index c93de7667..cf2a2f8a0 100644 --- a/src/backend/langflow/__main__.py +++ b/src/backend/langflow/__main__.py @@ -7,6 +7,9 @@ from langflow.main import create_app import typer from fastapi.staticfiles import StaticFiles from pathlib import Path +import logging + +logger = logging.getLogger(__name__) def get_number_of_workers(workers=None): @@ -23,7 +26,14 @@ def replace_port(static_files_dir, host, port): # we need to set the base url to the port that the server is running on # so that the frontend can make requests to the backend # This is a hacky way to do it, but it works - new_string = f'setItem("port","http://{host}:{port}")' + + # Check if the host is http or https + logger.info(f"host: {host}") + logger.info(f"port: {port}") + url = f"{host}:{port}" if "http" in host else f"http://{host}:{port}" + logger.info(f"url: {url}") + new_string = f'setItem("port","{url}")' + with open(static_files_dir / "index.html", "r") as f: index_html = f.read() # using regex to replace the port diff --git a/src/frontend/package.json b/src/frontend/package.json index 494db2ed3..3a1380681 100644 --- a/src/frontend/package.json +++ b/src/frontend/package.json @@ -53,5 +53,6 @@ "last 1 firefox version", "last 1 safari version" ] - } + }, + "proxy": "http://localhost:7860" } \ No newline at end of file diff --git a/src/frontend/public/index.html b/src/frontend/public/index.html index c1953d6b8..655da154e 100644 --- a/src/frontend/public/index.html +++ b/src/frontend/public/index.html @@ -4,6 +4,7 @@ +