需求
I would like to set environment specific OCC Base URLs
Development
Staging
Production
现在遇到的问题
Currently in the build job, SAP Commerce Cloud always run ng build command which always pick the default app.module.ts irrespective of maintaining this property in environment specific basis, hence all environments will have one environment’s OCC base urls which is not correct.
SAP Commerce Cloud does not provide this option in the specific environment occ base URL for build and deployment
文档:https://sap.github.io/spartacus-docs/configuring-base-url/
然而,This link does not say How to maintain three different OCC base urls for 3 environments
Dear customer, you can set your js app so that it automatically adds the baseurl. See help topic for hosting javascript apps:
In your Spartacus app:
index.html has to have
In app.module.ts, remove or comment out baseUrl
During build, the hosting service will substitute the proper server value.