This repository contains a CAP-based application which we use to test the SAP Cloud SDK functionality in a SAP BTP Cloud Foundry environment.
The repositories' structure is as following:
/src- Contains the application's source code with a CAP service handler implementation/srv- Contains the CDS rervice definitions and implementations/db- Contains CDS Domain Models and database-related stuffmanifest.yml- Manifest to deploy to SAP BTP Cloud Foundry
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/cds-sample-application
The Business Partner service cloud service definitions in EDMX format is already downloaded in the folder resources/service-specs. The client is generated using the npm run generate-client command. This command is executed automatically in the postinstall step after you execute npm i .
Note These service is licensed under the terms of SAP API Information License. This limits its use to development purposes only.
Before you can deploy the application, you have to create a destinationand xsuaa service instance.
Their name should match the one that is used in the manifest.yml, in this case:
destination-servicexsuaa-service
Run npm run deploy in the root to deploy the application to SAP BTP Cloud Foundry. This command will transpile the application from TypeScript to JavaScript using the ci-build script, package our deployment using the ci-package script and deploy the application using cf push.
To run the application locally, run npm run cds-deploy and then npm run start:dev.