I am trying to make an Angular 2 app running on App Engine Standard Environment. It works with the following app.yaml
configuration when navigating within the app:
handlers:
- url: /api/.*
script: _go_app
- url: (.*)/
static_files: static\1/index.html
upload: static
- url: (.*)
static_files: static\1
upload: static
I can click on a link from /
to /clients
or /clients/234234
and it works fine.
However if I refresh the browser in a non base path e.g. http://myapp.appspot.com/clients/234234
then I get a 404 error. I guess I need to serve my index.html
from all paths which is what I thought (.*)/
and (.*)
would do.
How can I set up my handlers/app so I can use HTML5 routing and not let this happen?