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 map" } ]}
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