mirror of
https://github.com/EvolutionAPI/adk-python.git
synced 2025-07-16 04:02:55 -06:00
fix: serve web app at /dev-ui/
PiperOrigin-RevId: 763965859
This commit is contained in:
parent
618c824994
commit
0c4f52699b
@ -858,14 +858,16 @@ def get_fast_api_app(
|
|||||||
ANGULAR_DIST_PATH = BASE_DIR / "browser"
|
ANGULAR_DIST_PATH = BASE_DIR / "browser"
|
||||||
|
|
||||||
@app.get("/")
|
@app.get("/")
|
||||||
async def redirect_to_dev_ui():
|
async def redirect_root_to_dev_ui():
|
||||||
return RedirectResponse("/dev-ui")
|
return RedirectResponse("/dev-ui/")
|
||||||
|
|
||||||
@app.get("/dev-ui")
|
@app.get("/dev-ui")
|
||||||
async def dev_ui():
|
async def redirect_dev_ui_add_slash():
|
||||||
return FileResponse(BASE_DIR / "browser/index.html")
|
return RedirectResponse("/dev-ui/")
|
||||||
|
|
||||||
app.mount(
|
app.mount(
|
||||||
"/", StaticFiles(directory=ANGULAR_DIST_PATH, html=True), name="static"
|
"/dev-ui/",
|
||||||
|
StaticFiles(directory=ANGULAR_DIST_PATH, html=True),
|
||||||
|
name="static",
|
||||||
)
|
)
|
||||||
return app
|
return app
|
||||||
|
Loading…
Reference in New Issue
Block a user