cancel
Showing results for 
Search instead for 
Did you mean: 

CAP approuter works locally. But giving 404 error in deployed approuter URL.

mishra_mayank
Explorer
0 Kudos
1,814

Hi experts,

I have created a CAP application using CDS method. And for approuter I have included freestyle SAPUI5 as frontend module. When I run locally, it is working fine, since it fetches oauth2-configuration and destination from default-env.json. Whereas, after deploying (used ignore in build-parameter to exclude default-env.json file), it is giving "404 Not found" error.


Can you please help me in following 2 issues,

  1. SAP logon page is not promoting when I open approuter URL in browser (incognito-mode - so no SAML). And not automatically routing to /<ui5 module name>/webapp/index.html (this I kept in welcomeFile config in xs-app.json).
  2. If I am trying to fetch srv module odata services through approuter URL like <approuter_URL>/catalog/<my-service>. It is not redirecting/fetching destination (set in BTP) and it is giving "404 not found" error. Note: This is working when run locally.

I'm new to XSUAA topic and appreciate your help.

PFA,

srv module output:

respective approuter module output:

Best regards,

Vignesh K

gregorw
Active Contributor

I would suggest you add also the CAP tag.

View Entire Topic
CarlosRoggan
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello,
you can add following env variable, to see debug info in console.
This should help to see where exactly the request fails:

env:
    CF_NODEJS_LOGGING_LEVEL: "debug"

Furthermore, you could add more configuration code snippets to your question.
Have you bound your app to xsuaa?
How do you define / create destinations?
Is destination defined in correct subaccount/app-level?
Have you tried setting the destination in the env (just as first approach)?

Kind Regards,

Carlos

mishra_mayank
Explorer
0 Kudos

Hi,
I have followed this blog only Deploy CAP with SAP HANA Cloud project as MTA | Tutorials for SAP Developers.
When I ran locally it is working (with destination config in default-env.json). Only when I deploy, it is not working (env file is ignored here). It seems the destination is not applying. Please find the below screenshots are destination configuration in BTP.

Can you please help me with which configuration I am missing here?

Regards,

Vignesh K