diff --git a/pyproject.toml b/pyproject.toml index 10b406044..f68736f7e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "langflow" -version = "0.0.41" +version = "0.0.42" description = "A Python package with a built-in web application" authors = ["Logspace "] packages = [ 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-lock.json b/src/frontend/package-lock.json index a3bd7c1d9..dffaa4665 100644 --- a/src/frontend/package-lock.json +++ b/src/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "langflow", - "version": "0.1.1", + "version": "0.1.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "langflow", - "version": "0.1.1", + "version": "0.1.2", "dependencies": { "@emotion/react": "^11.10.5", "@emotion/styled": "^11.10.5", @@ -17080,9 +17080,9 @@ } }, "node_modules/webpack": { - "version": "5.75.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.75.0.tgz", - "integrity": "sha512-piaIaoVJlqMsPtX/+3KTTO6jfvrSYgauFVdt8cr9LTHKmcq/AMd4mhzsiP7ZF/PGRNPGA8336jldh9l2Kt2ogQ==", + "version": "5.76.2", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.76.2.tgz", + "integrity": "sha512-Th05ggRm23rVzEOlX8y67NkYCHa9nTNcwHPBhdg+lKG+mtiW7XgggjAeeLnADAe7mLjJ6LUNfgHAuRRh+Z6J7w==", "dependencies": { "@types/eslint-scope": "^3.7.3", "@types/estree": "^0.0.51", diff --git a/src/frontend/package.json b/src/frontend/package.json index 494db2ed3..01be61167 100644 --- a/src/frontend/package.json +++ b/src/frontend/package.json @@ -1,6 +1,6 @@ { "name": "langflow", - "version": "0.1.1", + "version": "0.1.2", "private": true, "dependencies": { "@emotion/react": "^11.10.5", @@ -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 @@ + LangFLow