I\'m developing a spring backend for a react-based single page application where I\'m using react-router for client-side routing.
Beside the index.html page the back
Found an answer by looking at this question
@Bean
public EmbeddedServletContainerCustomizer notFoundCustomizer() {
return new EmbeddedServletContainerCustomizer() {
@Override
public void customize(ConfigurableEmbeddedServletContainer container) {
container.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/"));
}
};
}