We are evaluating developing UIs implemented with Angular straight on IS packages, similar to the ones used by API Gateway and newest IS Administration UI.
In general there is no problem with this: it is just a matter of copying the results of ng build to the pub/ directory of a package and setting up baseHref and IS aliases; although for Angular routing there is something missing.
One of the requisites for Angular routing to work is that, if a file is not found, the server (IS in this case) returns the index.html of the Angular application (see Angular ). However, I think this can’t be done by configuration in IS.
So far the workaround we have used is to manually create copies of index.html with the name of the known routes, although this is not a complete solution (doesn’t work for arbitrary routing parameters), and anyway looks awkward.
We have in mind creating a custom service that serves the files instead of just using pub/ and creating an URL alias pointing to it; it should work although we haven’t tried yet.
Is there a better way of doing this? More precisely, is there a way to configure, in IS, that when static pages are not found , a custom page is returned instead of the default 404 not found page? Moreover, it should be possible to configure in a per-package basis, not globally…
Thanks and best regards