This repository contains our Cloud Foundry sample application.
The repositories structure is as following:
/approuter- Contains the approuter, a packaging script and a manifest which is used in the deployment/src- Contains the application's source code with its 4 endpoints for cloud, onpremise and principal propagation/e2e-tests- Contains the cypress tests that test all endpoints after deploymentmanifest.yml- Manifest to deploy to SAP BTP Cloud Foundry
If you want to locally trigger the e2e-tests, create a cypress.env.json file in the /e2e-tests directory containing the credentials for the IdP in the format:
{
"username": "username",
"password": "password"
"url": "url"
}
The minimal requirements are:
- A terminal to execute commands
- A recent version of node and npm installed e.g. node 14 and npm 6
- An IDE or a text editor of your choice
If you want to explore the possibilities beyond local tests you need:
- Access to a SAP Business Technology Platform account
- Entitlement to use resources like service instance creation and application processing units
- Permission to deploy applications and create service instances
To download the application run:
git clone \
--depth 1 \
--filter=blob:none \
--sparse \
https://github.com/SAP-samples/cloud-sdk-js.git \
;
cd cloud-sdk-js
git sparse-checkout set samples/cf-sample-application
The following service definitions in EDMX format are already downloaded in the folder resources/service-specs:
The clients are generated using the npm run generate-client command. This command is executed automatically in the postinstall step after you execute npm i .
Note These services are licensed under the terms of SAP API Information License. This limits their use to development purposes only.
Before you can deploy the application and approuter, you have to create a destination, xsuaa, and connectivity service instance.
Their name should match the one that is used in the manifest.yml, in this case:
- sample-destination-service
- sample-xsuaa-service
- sample-connectivity-service
- Change all occurrences of
<REPLACE-ME>to your respective values, this includes destinations, your Subdomain, etc. - Change the
xs-app.jsonin the approuter directory to use either an IdP associated with your subaccount, or no IdP at all. - Run
npm run deployin the root, as well as in theapprouterdirectory to deploy the application to SAP BTP Cloud Foundry. - After both the
approuterand application are deployed, open theapprouter'surl to access the deployed application.
If anything isn't working as intended, search for <REPLACE-ME>, as all parts that have to be adapted contain this placeholder.