Start by creating a destination in the SAP Cloud platform to maintain the end point of the service:
Then open the SAP Cloud Platform Webide, create a new folder and the new HTML5 application descriptor:
Paste the following into Neo-app.json:
{ "Welcomefile": "Index.html", "Routes": [ { "Path": "/resources", "Target": { "Type": "Service", "Name": "Sapui5", "Entrypath": "/resources" }, "description": "SAPUI5 Resources" }, { "Path": "/test-resources", "Target": { "Type": "Service", "Name": "Sapui5", "Entrypath": "/test-resources" }, "description": "SAPUI5 Test Resources" }, { "Path": "/distance", "Target": { "Type": "Destination", "Name": "Google_map" }, "description": "Google maps" } ]}
Create a new index.html and enter the following:
<a href="distance/xml?origins=Walldorf&destinations=Paris">Distance from Walldorf to Paris:</a>
To test the app, click on the hyperlink:
You will find that the destination created in the first step is already in effect.
To get more original Jerry's technical articles, please follow the public number "Wang Zixi" or scan the QR code below:
Use destination services for Web applications on SAP cloud platforms