fastapi 多个webio_routes或者asgi_app挂载异常 第一个是ok的 其余404 #386
Unanswered
wanghaisheng
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
from .feedback import feedback
from .privacy import privacy
from .terms import terms
app = FastAPI()
app.mount("/", FastAPI(routes=webio_routes(index)))
app.mount("/feedback", FastAPI(routes=webio_routes(feedback)))
app.mount("/privacy", FastAPI(routes=webio_routes(privacy)))
termsapp = asgi_app(terms)
app.mount("/terms", termsapp)
唯一的区别在于index是和app定义在一个文件里 其余是独立引用的文件,方法本身是一模一样的
Beta Was this translation helpful? Give feedback.
All reactions