2025 Mar 07 7:34 AM - edited 2025 Mar 07 7:52 AM
Hello all,
I am currently working on a UI module of a mta project.
In my application I have two APIs, the default OData service and a REST API and I have maintained instance level destinations in BTP and calling the APIs when the app is running on BTP is totally fine.
I followed this blog and maintained a subaccount level destination as I am using managed app router.
However, when I call the APIs during local development, only the OData is working but the REST API is returning a Http 401 error.
This is my ui5.yaml
customMiddleware:
- name: fiori-tools-proxy
afterMiddleware: compression
configuration:
ignoreCertError: false # If set to true, certificate errors will be ignored. E.g. self-signed certificates will be accepted
ui5:
path:
- /resources
- /test-resources
url: https://ui5.sap.com
backend:
- path: /odata
url: <odata hostname>.com
- path: /workflow/rest
url: <REST API hostname>.com
My xs-app.json
"routes": [
{
"source": "^/odata/v2/(.*)$",
"target": "/odata/v2/$1",
"destination": "odata_dest",
"csrfProtection": false
},
{
"source": "^/workflow/(.*)$",
"target": "/workflow/$1",
"destination": "rest_api_dest",
"csrfProtection": false
}
]
The code to call the api
wfRequests = await Helper.callRest("/workflow/rest/v1/workflow-instances" + query, "GET");
Appreciate if you could provide me some input.
Best Regards,
HB
Request clarification before answering.
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 6 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.