bpHigh Claude Opus 4.7 (1M context) commited on
Commit
aa50c6c
·
1 Parent(s): 13b4881

Mount Gradio UI at root path so HF Spaces iframe shows it

Browse files

HF Docker Spaces iframe-load the container's root path (/). Our Gradio
UI was only mounted at /web, so the Space appeared blank. Keep /web for
backward compat with existing docs, also mount at / for HF.

Also drop the unsupported `base_path: /web` field from README frontmatter.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Files changed (2) hide show
  1. README.md +0 -1
  2. server/app.py +4 -1
README.md CHANGED
@@ -6,7 +6,6 @@ colorTo: red
6
  sdk: docker
7
  pinned: false
8
  app_port: 8000
9
- base_path: /web
10
  tags:
11
  - openenv
12
  ---
 
6
  sdk: docker
7
  pinned: false
8
  app_port: 8000
 
9
  tags:
10
  - openenv
11
  ---
server/app.py CHANGED
@@ -22,9 +22,12 @@ if _enable_web:
22
  # Create the base API app (reset/step/state/health/schema endpoints)
23
  app = create_fastapi_app(CarromEnvironment, Action, Observation)
24
 
25
- # Mount the custom Gradio UI
 
 
26
  import gradio as gr
27
  app = gr.mount_gradio_app(app, _gradio_app, path="/web")
 
28
  else:
29
  app = create_app(
30
  CarromEnvironment,
 
22
  # Create the base API app (reset/step/state/health/schema endpoints)
23
  app = create_fastapi_app(CarromEnvironment, Action, Observation)
24
 
25
+ # Mount the custom Gradio UI at BOTH paths:
26
+ # - "/" so HF Spaces' root-path iframe loads the UI directly
27
+ # - "/web" kept for backward compat with existing docs/links
28
  import gradio as gr
29
  app = gr.mount_gradio_app(app, _gradio_app, path="/web")
30
+ app = gr.mount_gradio_app(app, _gradio_app, path="/")
31
  else:
32
  app = create_app(
33
  CarromEnvironment,