File size: 657 Bytes
f9a1dd8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# main.py — single ASGI app (stable Shiny mount)

from fastapi import FastAPI
from shiny.asgi import ShinyApp
import shiny.express as sx  # import the package, not the submodule

from Deployment_UI import router as deployment_ui_router
from Deployment_UI_BE import router as deployment_be_router

app = FastAPI()
app.include_router(deployment_ui_router)  # serves /Deployment_UI
app.include_router(deployment_be_router)  # serves /api/...

# Mount Shiny Express at /
# Wrap the Shiny app with the ASGI adapter (prevents “module not callable”
# and avoids the submodule import that led to the hex/int ‘path’ error)
app.mount("/", ShinyApp(sx.app))