feat: add port option to cli

This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-03-05 21:55:44 +00:00
commit d70291d2c5

View file

@ -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():