cancel
Showing results for 
Search instead for 
Did you mean: 

UI5 VS code replace localhost with domain

frankmueller9
Participant
0 Kudos
1,413

Hello,
I'm using VSCode to develop UI5 apps on my computer with UI5-Toolings.
When I start the app with npm start, then a server will be started with name localhost. Due to some login restrictions, it is required that I start server with a domain name instead of localhost. So I added a domain name alias in the hosts file for localhost.
When I start the UI5 app with the index.html and the domain name in the URL then everything works fine. But if I start it with test/flpSandbox.html then I get the following error.

I assume that the reason for this is, that the app has been registered already for localhost instead of the domain name. When I try it with the localhost URL, then I don’t get this error, but I can not login due to the restrictions.
Is there a possibility to replace localhost with the domain name?

Best regards

Frank

View Entire Topic
TobiT
Participant
0 Kudos

Hi Frank,

your error seems to be something else:

likely caused by:
[...] with duplicate id

This is caused if you add two elements with the same id. Could be a component, plugin or control. Maybe double check that you only have unique namespaces inbetween your launchpad apps?

Somewhat related:

Putting entries in the host file of your computer isn't needed most of the time. Webapps should run on any hostname resolving their dependey mostly relative to the host.

For develppment have a look at:

https://www.npmjs.com/package/ui5-middleware-simpleproxy

With the proxy you can map e.g. 'localhost/resources' to 'https://sapui5.hana.ondemand.com/resources'

Cheers

frankmueller9
Participant
Hi Tobias,
thank you very much for your reply. I found out in the meantime that this cookie belongs to the SAML2 logon. Unfortunately does the middleware only support basic authentication.
I had to add the URL Parameter to disable SAML2 (saml2=disabled) to the Server URL. Unfortunately does the fiori-tools-proxy middleware not support additional URL parameters. I did a small hack and added it to the client. I can connect now with the basic authentication (user name and password) from localhost and I don’t get this error anymore. Here is the part of my ui5.yaml file:
...
server:
customMiddleware:
- name: fiori-tools-proxy
afterMiddleware: compression
configuration:
ignoreCertError: true
backend:
- path: /sap
url: "https://servername:44310"
client: "010&saml2=disabled" ...

Best regards

Frank