Search code examples
google-app-enginereactjsreact-routerredux-router

GAE web.xml to fallback to React-Router


I'm trying to build a new frontend on top of an existing GAE application using React, Redux and Redux-Router. My problem is figuring out how to make GAE always fallback to the html page where Redux-Router will take care of the routing.

Right now, if I go to '/' the app works fine and the navigation is perfect. When I refresh the page GAE kicks in and tries to find the route.

How do I configure GAE to always go the same html? oh, only if the url doesn't start with api/ to serve my data?

Thanks for the help


Solution

  • web.xml (under 2.5) allows you to wildcard the start or the end of the path (but not anywhere in the middle)

    You should achieve what you're after by using /* - which is basically any path not mapped by another rule. Your /api/*rule should continue to work.