StaticFiles not hosting files! #2844
-
Hi. For purposes of reproducing a problem I have in a real world app I have a test directory /opt/webapps/test with the following 2 files inside:
I cannot get my app to host / serve these files by their name:
If I add "html=True" argument then accessing / will serve up index.html but neither can be accessed directly by their filename (e.g. http://server:port/test.html results in "not found").
What am I doing wrong or is this a bug? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Please read the documentation: https://www.starlette.io/staticfiles/ |
Beta Was this translation helpful? Give feedback.
-
I've read this page more times than i can recall trying to figure this out, however it appears I have messed up in reproducing a simplified example and confused Mount vs Route, indeed the example I provided works with this corrected. I was using Mount in the real code but under a more complex context. I now suspect a mistake in that is the cause of the problem. |
Beta Was this translation helpful? Give feedback.
Please read the documentation: https://www.starlette.io/staticfiles/