I am attempting to configure my Spring Boot MVC application to serve some audio files under static\recordings
in my resources
directory.
I've added the following mapping
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/recordings/**.wav", "/recordings/**.mp3").addResourceLocations("/static/recordings/");
}
However, requesting either:
/recordings/general/en/en-general-choose-language.wav
static/recordings/general/en/en-general-choose-language.wav
Gives a 404, with this in the logs (adjusted slightly based on path, of course):
Looking up handler method for path /recordings/general/en/en-general-choose-language.wav
Did not find handler method for [/recordings/general/en/en-general-choose-language.wav]
I have a work-around with a Controller and writing the file contents to the response stream but it seems silly to have to do that to serve a static file.