Skip to content
This repository has been archived by the owner on Jul 4, 2024. It is now read-only.

Latest commit

 

History

History
70 lines (44 loc) · 1.71 KB

README.md

File metadata and controls

70 lines (44 loc) · 1.71 KB

Exercise 2 - PREPARE APP FOR LOCAL USE (optional)

Goal 🎯

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 application dependencies

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 kyma@cap.sap.com/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

Summary

🎉 Congratulations - You now can run the application locally.

Continue to Exercise 3 - CONFIGURE THE SAP CICD SERVICE

◀ Previous exercise | 🔼 Overview | Next exercise ▶