This exercise provides the commands to run the sample application locally. This is provided for informational purposes and is not needed to proceed with the tutorial.
Install the CDS tools
npm i -g @sap/cds-dk
Install the app dependencies
npm install --prefix components
The app can be run using the command
cds watch components
The application is set to use a mock user. The relating user details are defined in components/.cdsrc.json as [email protected]/initial
. This will not work if the NODE_ENV has been set to production.
⚠ NOTE: REQUIRES THE COMPLETION OF Exercise 5 - GENERATE THE CAP DATABASE
The application can also be configured to connect to the HANA Cloud instance. This first requires that the database has been fully setup which is performed in Exercise 5.
First set the VCAP_SERVICES environment variable
-
Using shell
export VCAP_SERVICES=$(<credentials/vcap_services.json)
-
Using PowerShell
$ENV:VCAP_SERVICES = Get-Content .\vcap_services.json -Raw
If necessary change the setting of the property cds.requires.db.kind within the components/package.json from sql
to hana
"cds": {
"requires": {
"db": {
"kind": "hana"
},
Then execute:
cds watch components
🎉 Congratulations - You now can run the application locally.
Continue to Exercise 3 - CONFIGURE THE SAP CICD SERVICE