It is recommended that the Angular web application is deployed under a context path. For example, assuming the application name MyApplication and the context path /myapplication, the resulting URL would be https://my-application-domain.com/static/myapplication.
To support this, the web application must be built using the appropriate base-href parameter value.
In your project root, run the following command:
ng build --prod --base-href /static/myapplication/
The context path must be enclosed in leading and trailing “/” characters.
Deploying the build to a PASOE
Assuming a custom output directory has not been provided, your build should now be located at <project_root>/dist/myapplication.
Copy the myapplication directory at the following location:
Configure the PASOE to support Angular deep links
Angular handles routing directly on the client. When a change in browser location is detected, Angular will try to match certain parts of the URL to Angular routes. When the application is hosted on a PASOE instance, this will work out of the box as long as navigation is performed after the Angular application was loaded.
However, if we attempt to open a specific Angular route directly (for example by bookmarking a page), the PASOE will return a 404 NOT FOUND error. This is because when using a deep link, the Angular application has not yet been loaded and thus is not handling the matching of URL segments to Angular routes.
To support this, the following changes need to be made to your PASOE configuration: