cancel
Showing results for 
Search instead for 
Did you mean: 

.Configuring local proxy for running Ui5 app locally, in order to avoid CORS error

former_member707385
Participant

Hi Experts,

I am trying to access a Odata service at a remote location. But I am getting CORS error.

I learned somewhere that there is a way to run the application locally by configuring local proxy.

Please let me know how can i create this local proxy and run my app in order to bypass CORS error.

Please note: I am using Visual Studio Code for development, using Open UI5 and need to run the app locally. Not using any destination at all.

Regards,

Anand

View Entire Topic
boghyon
Product and Topic Expert
Product and Topic Expert

See this answer. In your case, the simple proxy middleware should be sufficient. Here is a sample repo that uses the middleware and an OData V4 sample service.

former_member707385
Participant
0 Kudos

Hi @boghyon.hoffmann,

Sorry for late reply as I was on leave.

I have made the changes as suggested by you but my application still do not work.

After making the changes I am running my app using npm run start. But it do not pick up the "middleware proxy" whcih we created and this my OData service do not work.

Please let me know If I am missing any thing

Regards,
Anand

boghyon
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi anand.rai01

It's difficult to tell what's missing without any information.

  • What is your "OData service" in the first place? Is it the TripPin (V4 OData service) from odata.org? You mentioned the OData service is served from a remote location. Could you elaborate more on that? Did you create that OData service by yourself? With which tools? What is your tech stack?
  • What are the error messages you're getting? What have you tried so far?
  • Please show us your current settings and 1code related to the connection. Particularly manifest.json, package.json, and ui5.yaml.
boghyon
Product and Topic Expert
Product and Topic Expert
0 Kudos

anand.rai01 Is the newer answer https://stackoverflow.com/a/76554715/5846045 more helpful?