feat: add port option to cli
This commit is contained in:
parent
13918b9758
commit
d70291d2c5
1 changed files with 12 additions and 13 deletions
|
|
@ -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():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue