Open
Description
Using code from the panel fastapi tutorial:
import panel as pn
from fastapi import FastAPI
from panel.io.fastapi import add_application
app = FastAPI()
#from fastapi.staticfiles import StaticFiles
#app.mount("/static", StaticFiles(directory="my_app/static"), name="static")
@app.get("/")
async def read_root():
return {"Hello": "World"}
@add_application('/panel', app=app, title='My Panel App')
def create_panel_app():
slider = pn.widgets.IntSlider(name='Slider', start=0, end=10, value=3)
return slider.rx() * '⭐'
If I un-comment out the lines mounting a static dir the app no longer works and I get 404s from the bokeh js calls. I can get around this by changing the mount path in my app, but perhaps it would be more fool-proof if this package mounted the static files to a non-standard location? (e.g. /bokeh_static)
Thanks for your consideration.
For reference I am using:
bokeh_fastapi 0.1.3
fastapi 0.115.12
panel 1.6.3
Metadata
Metadata
Assignees
Labels
No labels