on 2024 Oct 16 8:41 AM
Hello SAP Community,
I have deployed a full-stack project on SAP BTP using Cloud Foundry, and everything is working fine with my AppRouter. After deployment, I received the following URL for my AppRouter:
When I access this URL, it correctly redirects me to the welcome file (as specified in my AppRouter configuration), and my application (a SAP UI5 project) runs as expected. However, when inspecting the network traffic in the browser's console, I noticed that the app is attempting to fetch the following URL even though I haven't requested data from this service yet:
https://245509888trial-demo-fulldeploy.cfapps.us10000001.hana.ondemand.com/project125/odata/v4/library/
project125 is the name of my UI5 application folder, which is inside the welcome file path in the AppRouter.
library: is the base path for one of my OData services.
The issue is that this URL is returning a 404 status because the app seems to be appending the UI5 application path (project125) to the OData service URL (/odata/v4/library/), resulting in an incorrect URL: .../project125/odata/v4/library/.
Request clarification before answering.
I think your approuter's xs-app.json should be like the one below. Please note that you have to put more restrictive route first in the routes array.
{
"authenticationMethod": "route",
"logout": {
"logoutEndpoint": "/app-logout",
"logoutPage": "/"
},
"routes": [
{
"source": "^/odata/(.*)$",
"target": "/odata/$1",
"destination": "srv-api",
"csrfProtection": true,
"authenticationType": "none"
},
{
"source": "^/app/(.*)$",
"target": "$1",
"localDir": ".",
"cacheControl": "no-cache, no-store, must-revalidate"
},
{
"source": "^/user-api(.*)",
"target": "$1",
"service": "sap-approuter-userapi"
},
{
"source": "^/appconfig/",
"localDir": ".",
"cacheControl": "no-cache, no-store, must-revalidate"
}
],
"welcomeFile": "/project125"
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
42 | |
6 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.