Comments (4)
This is the intended behavior of FastAPI so I will close.
from fastapi import FastAPI
parent = FastAPI()
root = FastAPI()
child = FastAPI()
@root.get("/")
def hello():
return "Hello"
@child.get("/hi")
def hi():
return "hi"
parent.mount("/", root)
parent.mount("/child", child)
if __name__ == "__main__":
import uvicorn
uvicorn.run(parent, port=7860)
I suggest you don't place either app at the root and redirect visitors of the home page to whichever child app you want.
from fastapi import FastAPI
from fastapi.responses import RedirectResponse
parent = FastAPI()
root = FastAPI()
child = FastAPI()
@parent.get("/")
def go_to_root():
return RedirectResponse("/root")
@root.get("/")
def hello():
return "Hello"
@child.get("/")
def hi():
return "hi"
parent.mount("/root", root)
parent.mount("/child", child)
if __name__ == "__main__":
import uvicorn
uvicorn.run(parent, port=7860)
from gradio.
I have not looked into it but I think this makes sense. When you mount gradio at the root /
, the request to /gradio
will be sent to the gradio app at the root, which does not have a way to fulfill that request.
Does this problem happen if the first app is not mounted at /
? Or if you switch the order of the mounting (first mount at /gradio
then /
)?
from gradio.
The problem does not happen if the first app is not mounted at /
, but it still happens if I switch the order of the mounting.
from gradio.
Thank you, @freddyaboulton very helpful !
from gradio.
Related Issues (20)
- Multiple audios in sequence HOT 2
- The JS client's handle_file does not work properly in the browser HOT 3
- The drop area is too restricted in Image
- Less and less people using gradio and it's your fault! HOT 2
- gradio 4.37.1 the address of theme.css and upload imgae is not right HOT 2
- gr.Chatbot cannot use gr.Markdown / gr.DataFrame while showing the results HOT 4
- Oauth flow not working locally
- Error following custom components docs gradio cc dev (virtual:component-loader) HOT 8
- File file_types restricts the type of file uploaded but can be overridden
- RTL for HighlightedText component
- Chatbot AI message borders have disappeared as well as Like boxes HOT 4
- Canvas_size doesn't work after uploading image
- Can you explain which library you use to read 'ply' files into a 3D model? HOT 2
- Custom Component unable to view in dev server HOT 1
- Code component event listeners not working properly when being dynamically rendered with gr.render
- Network check can time out too easily HOT 1
- Host port lost on theme.css behind Nginx HOT 2
- Radio corner rounding doesnt apply in gr.Group HOT 1
- gradio_pdf component in private space not usable from public space HOT 8
- Error when passing in a custom chatbot to add like/dislike feature to Chatinterface HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gradio.