Hi, I managed to setup angular application in App platform as static site. The problem is, that I cant setup redirect all paths to index.html

Is it possible to run SPA application in App platform using static sites?

Thank you

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

2 answers

👋 @raold

App Platform does not currently have the functionality to redirect but it’s something we’re looking into.

As a workaround, your Angular app should support routing which will allow you to put a catch-all route.

It looks like you can set up each route in “Components/HTTP Routes”, but I don’t see an easy was to set a catch-all. Perhaps overriding the static_sites/error_document key would do it (as referenced here:
https://www.digitalocean.com/docs/app-platform/references/app-specification-reference/ )
but I’m assuming that is responding with a 404, which wouldn’t be good.

Submit an Answer