lemaiwo / ui5-middleware-route-proxy

UI5Tooling route proxy
MIT License
11 stars 4 forks source link

use route proxy to get resources from SAP Netweaver or CDN? #14

Open DenisGalandSAP opened 3 years ago

DenisGalandSAP commented 3 years ago

Hello Wouter,

I would like to leverage the power of the new UI5 generator 3.0, my issue is most of our (Flexso) clients are in SAPUI5 1.71 or below.

So after checking the documentation about the framework of the UI5 tooling, we can tell the framework to take a lower version than 1.76. And I would like to not hardcode the sapui5 version in the bootstrap in the index.hml directly, or I could forget to revert to a relative path for the resources, before pushing the new version of the application to the SAP Netweaver.

So I tried this in the index.html

    <script
        id="sap-ui-bootstrap"
        src="/resources/sap-ui-core.js"
        data-sap-ui-theme="sap_fiori_3"
        data-sap-ui-resourceroots='{
    "z.ztest5": "./"
  }

and in the ui5.yaml

name: ui5-middleware-route-proxy afterMiddleware: compression configuration: debug: false /sap/opu/odata/sap/: target: http://: auth: fromEnv: false user: pass: /resources/: target: https://sapui5.hana.ondemand.com/1.71.14/resources/ replacePath: true changeOrigin: true

As that target is public I could have been easier to use for a test, but it fails.

Would it be possible to use the route proxy in that sense? Or do you have an isea of another way?

lemaiwo commented 3 years ago

I meanly use the route-proxy for my odata requests.

In your scenario it would be sufficient to use the ui5 simple proxy https://www.npmjs.com/package/ui5-middleware-simpleproxy

DenisGalandSAP commented 3 years ago

Ok, thank you Wouter, I will try this.