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

ASGI root_path #62

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

ASGI root_path #62

wants to merge 1 commit into from

Conversation

abersheeran
Copy link
Owner

No description provided.

Copy link

codecov bot commented Dec 12, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (174c21a) 100.00% compared to head (cea76da) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master       #62   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           26        26           
  Lines         1990      1996    +6     
=========================================
+ Hits          1990      1996    +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: cea76da
Status: ✅  Deploy successful!
Preview URL: https://035c6828.baize.pages.dev
Branch Preview URL: https://fix-asgi-path.baize.pages.dev

View logs

@gegogi
Copy link

gegogi commented Feb 3, 2025

@abersheeran
This patch looks old but still valid.
Do you have a plan to merge it?

@abersheeran
Copy link
Owner Author

I want to wait django/asgiref#424

@gegogi
Copy link

gegogi commented Feb 4, 2025

Is there a good way to make the following code work?
It used to work before but not on the latest version of baize.
When I GET '/data/a.mp4', it accesses a wrong fs path '/mnt/video_data/data/a.mp4'.
It had accessed the correct '/mnt/video_data/a.mp4' on the past version which I cannot remember.
Putting the video files in '/mnt/video_data/data/' is not an option for me.

from starlette.staticfiles import StaticFiles
from baize.asgi import Files

app = FastAPI()
app.mount('/static', StaticFiles(directory='static'), name='static')
app.mount('/data', Files(directory='/mnt/video_data'), name='data')

@abersheeran
Copy link
Owner Author

You can start a new discussion to talk about this issue; it's not appropriate to bring it up in the PR.

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.

2 participants