on 2024 Oct 14 7:12 PM
I have an HTML5 application built purely with HTML, JavaScript, and CSS (not on SAP UI5), and I need to call a CAP (Cloud Application Programming) service on SAP BTP. When I try to make the request from the front-end, I'm encountering a CORS (Cross-Origin Resource Sharing) issue.
What are the steps to resolve this CORS issue, and how can I configure my CAP service or AppRouter to allow cross-origin requests from my HTML5 app?
Thanks in advance.
#
Request clarification before answering.
Beside the solution from Wouter I think you should check out the examples at multi-cloud-html5-apps-samples. Either use the custom or managed approuter. Using xs-app.json you configure a proxy to the CAP backend and that way you can avoid CORS issues. Also the Approuter allows you to add authentication.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
77 | |
30 | |
8 | |
8 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.