cancel
Showing results for 
Search instead for 
Did you mean: 

hana xs advanced app router ui5 external access

patrickwenger
Participant

In my xs advanced app I use the replace functionality of the approuter to set the value of my ui5liburl variable to the correct value (host:port) of the central fesv3 application in order to use this variable in the bootstraping part of my index.html file.

My xs-app.json file looks as follows (only relevant parts):

"welcomeFile": "index.html",

"authenticationMethod": "route",

"routes": [

{

"source": "/(.*)",

"localDir": "resources",

"authenticationType": "xsuaa",

"replace": {

"pathSuffixes": ["index.html", "odataTest.html"],

"vars": ["ui5liburl"]

}

}]

}

My mta.yaml file looks as follows (only relevant parts):

modules:

- name: web

type: html5

path: web

requires:

- name: ui5-lib

properties:

ui5liburl: '~{url}'

resources:

- name: ui5-lib

type: configuration

parameters:

provider-id: 'com.sap.ui5.dist.sapui5-dist-xsa.XSAC_UI5_FESV3:sapui5_fesv3'

version: '>=1.44.0'

In my index.html file I use the variable ui5liburl like this:

<script id="sap-ui-bootstrap" src="{{{ui5liburl}}}/resources/sap-ui-core.js"

When I build and run my app everything works like expected. The url to the sapui5 resources is replaced with the correct values from the fesv3 central app.

However, using this configuration there are two ports that have to be accessible from the internet. One for the approuter and another one for the ui5-lib. This of course is not ideal. A better solution would be to have only one url (hostname:port) which had to be allowed for external access in our firewall configuration. This url would of course be the one from the approuter. The approuter should then make the ui5-lib accessible using its reverse prox functionality, i.e. the same hostname:port for external access but the change the port to the correct port of the fesv3 service. However, I was not able to configure this behaviour in the xs-app.json file. What I am looking for is something linke the following:

{

"welcomeFile": "index.html",

"authenticationMethod": "route",

"routes": [

{

"source": "/resources/libui5/(.*)",

"destination": "ui5lib",

"authenticationType": "xsuaa",

]}

}

Then in the mta.yaml file the destination "ui5lib" should be routet to the central fesv3 app, This means it should be possible to configure something like this:

- name: core_configuration

type: configuration

provides:

- name: ui5lib

properties: url: '${default-url}'

requires:

-name: ui5lib_central

resources:

- name: ui5lib_central

type: configuration

parameters:

provider-id: 'com.sap.ui5.dist.sapui5-dist-xsa.XSAC_UI5_FESV3:sapui5_fesv3'

version: '>=1.44.0'

Of course, the module type "configuration" does not exist. Its purpose is only to demonstrate what I mean.

So, my question is as follows: Is it possible to configure a MTA-Project so that it behavies as described?

Any help would be appreciated.

Best regards, Patrick

Accepted Solutions (0)

Answers (0)