diff --git a/langflow/cli.py b/langflow/cli.py index 5837bd111..99805b3e5 100644 --- a/langflow/cli.py +++ b/langflow/cli.py @@ -1,24 +1,23 @@ +from langflow.backend.app import create_app + import typer +import uvicorn from fastapi.staticfiles import StaticFiles from pathlib import Path -from langflow.backend.app import create_app - -# get the directory of the current file -path = Path(__file__).parent -static_files_dir = path / "frontend/build" app = create_app() -app.mount( - "/", - StaticFiles(directory=static_files_dir, html=True), - name="static", -) def serve(port: int = 5003): - import uvicorn - - uvicorn.run(app, host="localhost", port=port) + # get the directory of the current file + path = Path(__file__).parent + static_files_dir = path / "frontend/build" + app.mount( + "/", + StaticFiles(directory=static_files_dir, html=True), + name="static", + ) + uvicorn.run(app, port=port) def main():