I am trying to build a web app to retrieve audio files from the backend. Problem is, while my spring application was serving audio files successfully with the path localhost:8080/api/get/audio/1 (1 being the songId in my DB), It no longer works when trying to access it through my web app, neither through domain name or directly with IP. It gives a 404 Not Found. I'm not exactly sure what is causing this issue, looking for ideas. All suggestions appreciated!
#Accessing Spring API for audio/mpeg files
9 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @primal crescent! Please use
/closeor theClose Postbutton above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
I don't have any custom logging set up, but the default Spring log doesn't seem to give any logs on it. I tried to access an invalid URL which correctly returned the given response body below, but when I tried the one in question (/api/get/audio/1), it just returns a 404 with no body.
And with an invalid path, the Spring logs PageNotFound, as expected (Which it doesn't for the correct audio path).
if its not returning any body you probably have some exception handling ignored
Perhaps so, but I don't think that affects the situation. I want to understand why it doesn't return the audiofile, eventhough it exists on the server environment.