insistence

Results 21 comments of insistence

@tiangolo Excuse me, would it be convenient for you to prioritize this PR?

Similar issue, after setting root_path to uvicorn, mounting the gradio app in fastapi shows 404 error. The same error still occurs when the front-end uses the Vite proxy. ``` from...

登录接口请求参数需要是表单类型,看看你前端是不是写错了

> > 登录接口请求参数需要是表单类型,看看你前端是不是写错了 > > 是的,前端还没改,我想调试中去改,能否请教下断点应该设置在哪里才有效呀 这类错误是fastapi内部默认处理的

感谢反馈,也欢迎提pr

这样修改你会发现前端无法正常获取静态文件,这是fastapi目前存在的一个bug,已有相关的pr,待合并后应该就正常了

> > 这样修改你会发现前端无法正常获取静态文件,这是fastapi目前存在的一个bug,已有相关的pr,待合并后应该就正常了 > > 在app.py中去掉root_path配置,在server.py中新增配置 `docs_url=AppConfig.app_root_path + '/docs'`,这样就能解决这个问题了 > > ``` > # 初始化FastAPI对象 > app = FastAPI( > title=AppConfig.app_name, > description=f'{AppConfig.app_name}接口文档', > docs_url=AppConfig.app_root_path + '/docs', > version=AppConfig.app_version, >...

> > 这样修改你会发现前端无法正常获取静态文件,这是fastapi目前存在的一个bug,已有相关的pr,待合并后应该就正常了 > > 我再次尝试了一下,backend 修改如 @buptzyf 这个老哥写一样,把root_path=AppConfig.app_root_path 配置从app.py改到server.py来,然后修改 frontend 的 vite 的 proxy 配置,不要 rewrite 配置就行: > > ``` > proxy: { > // https://cn.vitejs.dev/config/#server-proxy > "/dev-api": {...

无法复现,具体的场景是什么

如果可以复现,可以再发起一个issue