This has been configured in some of my previous blogs but I thought the topic deserved its own post, short and sweet.
When needing to set up CORS configuration I found that it could be placed in a user-provided variable after application deployment. This was done via the cockpit and became rather tedious after multiple deployments.
Whilst making unrelated changes to an mta.yaml file I had the simple realization, this can be directly configured per module. Simply place the following property against your module definition in the mta.yaml
any mta.yaml that requires CORS
modules: - name: provider type: html5 path: provider properties: CORS: - uriPattern: . allowedMethods: - GET - POST allowedOrigin: - host: '*.ondemand.com'
That is all there is to it, enjoy!