Client redirect "trick" for angular routes with no match in S3
This pattern, using an api gateway for static websites, uses an undocumented "trick" to to make angularroutes work when the path asked doe not exists in the S3 behind.
Indeed, S3 will return a 404 error to the gateawy if an url like https://myapp/home is called, because there is no "home" in S3. The 404 response is handled by the gateway, but returned to the client with a body that does a local redirect with some javascript / use of window.location to trigeer the angular route locally.
This trick is in the openapi files in the infra repositroy, but not documented (thus not visible if we publish / have our own open api spec), and to be honest does not seems very "elegant" especially since it is visible by the client app. A rewrite response would be better, but it seems not possible with a gateway at least for my understanding.
For information, a pattern that use the ALB to expose an S3 has also been tested and have the same problem (without the capacity to apply this trick).
It should at least be mentionned as a limit of this pattern I think (a better one would be to enable web site hosting directly on S3 for thos use case - staic angular app, that has no data outside of api calls - or the use of cloudfront).