title: Spring catch all route for index.html
body: <p>I'm developing a spring backend for a react-based single page application where I'm using react-router for client-side routing.</p>
  
  <p>Beside the index.html page the backend serves data on the path <code>/api/**</code>.</p>
  
  <p>In order to serve my index.html from <code>src/main/resources/public/index.html</code> on the root path <code>/</code> of my application I added a resource handler</p>
  
  <pre><code>@Override
  public void addResourceHandlers(ResourceHandlerRegistry registry) {
      registry.addResourceHandler("/").addResourceLocations("/index.html");
  }
  </code></pre>
  
  <p>What I want to is to serve the index.html page whenever no other route matches, e.g. when I call a path other than <code>/api</code>.</p>
  
  <p>How do I configure such catch-all route in spring?</p>