From 0c4f52699bdb6187651e83f0c787faf3a945f74c Mon Sep 17 00:00:00 2001 From: Yifan Wang Date: Tue, 27 May 2025 15:13:49 -0700 Subject: [PATCH] fix: serve web app at /dev-ui/ PiperOrigin-RevId: 763965859 --- src/google/adk/cli/fast_api.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/google/adk/cli/fast_api.py b/src/google/adk/cli/fast_api.py index b4909bc..bd370e8 100644 --- a/src/google/adk/cli/fast_api.py +++ b/src/google/adk/cli/fast_api.py @@ -858,14 +858,16 @@ def get_fast_api_app( ANGULAR_DIST_PATH = BASE_DIR / "browser" @app.get("/") - async def redirect_to_dev_ui(): - return RedirectResponse("/dev-ui") + async def redirect_root_to_dev_ui(): + return RedirectResponse("/dev-ui/") @app.get("/dev-ui") - async def dev_ui(): - return FileResponse(BASE_DIR / "browser/index.html") + async def redirect_dev_ui_add_slash(): + return RedirectResponse("/dev-ui/") app.mount( - "/", StaticFiles(directory=ANGULAR_DIST_PATH, html=True), name="static" + "/dev-ui/", + StaticFiles(directory=ANGULAR_DIST_PATH, html=True), + name="static", ) return app