In my Spring Boot application, I have a code like this:
registry.addResourceHandler("resources/**").addResourceLocations("file:///" + path