20 minutes
In this exercise, we will deploy the application to SAP Cloud Platform Cloud Foundry environment. The multiple components of the app is visualized and monitored from SAP Cloud Platform Cockpit.
- Inside the
uifolder of the project, add the following lines of code toxs-app.json.
{
"source": "^/booking/(.*)$",
"destination": "backend"
}
xs-app.json now looks as shown below:
- In the project root folder, right click on
mta.yamlfile and open it using the MTA editor as shown.
- Choose
uimodule and scroll down torequiressection, Click on the + button and pick the optionsrv_api(provider)as shown:
Include the destinations value under Group. Add the following three properties as key value pairs by clicking the + button as shown:
name: backend
url: ~{url}
forwardAuthToken: trueNow click on dest_cloud-sample-spaceflight-node and delete it using the delete button as shown below.
- Goto the
Resourcestab of the same file in the top. Choosecloud-sample-spaceflight-node-uaaand click on delete button as shown.
Next choose dest_cloud-sample-spaceflight-node and click on delete button as shown.
Finally save the mta.yaml file.
- Right click at the project level and choose
Buildand again click onBuild.
This will generate a multi-target archive file as shown under a folder called mta_archives. This may take a couple of seconds.
- Right click on the .mtar file -> choose
Deploy-> click onDeploy to SAP Cloud Platform.
- Enter the Cloud Foundry API Endpoint, Organization and Space as shown: (Space will differ for each user)
This will take around 5 to 10 minutes. And then your application is deployed to cloud foundry environment of SAP Cloud Platform.
- Go to SAP Cloud Platform Cockpit and navigate into the right space to see your applications running.
Congratulations, you successfully built the space travel node application using the programming model of SAP Cloud Platform!











