Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: mounted apps don't eagerly match path prefix #5190

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

frostming
Copy link
Collaborator

@frostming frostming commented Jan 22, 2025

Signed-off-by: Frost Ming me@frostming.com

What does this PR address?

With this change, the following will be possible:

import bentoml
from fastapi import FastAPI

app = FastAPI()


@app.get("/hello")
def hello():
    return {"Hello": "World"}


@bentoml.service
@bentoml.asgi_app(app, path="/")
class MyService:
    pass

Visiting / renders the swagger page, and visiting /hello gives the fastapi response. Previously, the app mounted at the root path / will shadow all internal endpoints

Signed-off-by: Frost Ming <me@frostming.com>
@frostming frostming requested a review from a team as a code owner January 22, 2025 04:01
@frostming frostming requested review from aarnphm and removed request for a team January 22, 2025 04:01
@aarnphm aarnphm merged commit a3959b7 into bentoml:main Jan 22, 2025
49 of 51 checks passed
@frostming frostming deleted the fix/passive-mount branch January 22, 2025 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants