cancel
Showing results for 
Search instead for 
Did you mean: 

CAP Application getting 404 after deployment to CF

ChristianSislak
Associate
Associate
2,065

Hi all,

I was following this tutorial: https://developers.sap.com/group.deploy-full-stack-cap-application.html

After deploying the application to cloud foundry environment, which worked fine so well, I cant open the application. What I get is an: 

Cannot GET /

ChristianSislak_0-1724145074536.png

Do you guys have any idea why this happens?

 

 

Accepted Solutions (1)

Accepted Solutions (1)

Dinu
Active Contributor
0 Kudos

/ is not served when the app is deployed to cloud foundry. Access a served service by the path. 

See https://cap.cloud.sap/docs/node.js/cds-server#toggle-generic-index-page

 

ChristianSislak
Associate
Associate
0 Kudos
Hi Dinu, thx, but Im not sure what u meant? I created an CAP application, which is provided in my space. If Im trying to open the application route from the running application space (https://7e1e8b88trial-7e1e8b88trial-cap-space-incident-management-srv.cfapps.us10-001.hana.ondemand....) it dont work and the error appears.
Dinu
Active Contributor
When you run CAP application locally, the server serves a generic index page with the list of services and their paths. This index page is not served in production. When the application is deployed to CF, it is considered in production. Even if the index page is not served, the services are served at the same paths as in development. You will have to replace the hostname in the URL for these services with the URL of the deployed app and access the services.
eshrinivasan
Developer Advocate
Developer Advocate
Add "cds" : { "server": { "index": true } } to the package.json

Answers (0)