I have the following structure
ui
dist
index.js
backend
src
main
java
org
example
Application.java
I am trying to present index.js as a static resource. I tried the following in my application...
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/ui/*")
.addResourceLocations("file:///../ui/dist");
}
But this doesn't host the file like I would expect.
How do I host a relative file as a static resource using Spring Boot?
This worked for me...