Skip to content

Please assist- Axum, tower-http, ServeDir: External javascript file referenced from index.html '404 Not Found' #2874

Answered by mladedav
xabra asked this question in Q&A
Discussion options

You must be logged in to vote

I suspect this could be another case of the /home/ vs /home nesting issue.

When you called /home, the directory is / so the browser tried to fetch /my-script.js. If you had used nest_service("/home/", ...); and called localhost/home/ instead, I think it would correctly use the relative path as /home/my-script.js.

You could try calling locahost/home/index.html, I think that version should work. I didn't try to run any code though, so I'm just extrapolating and guessing here.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@xabra
Comment options

@mladedav
Comment options

Answer selected by xabra
@xabra
Comment options

@xabra
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants