This is a sample CAP application that mimics the Northwind OData service, both V2 and V4. It can optionally be used in conjunction with the managed-html5-runtime-fiori-launchpad-mta to replace the original Northwind service - demonstrating how to consume CAP service from that sample.
The original public Northwind service does not require any authentication, whereas this CAP project requires XSUAA authentication. By deploying this CAP application in the same Cloud Foundry space as the managed-html5-runtime-fiori-launchpad-mta, you override the destination URL of the original Northwind service with the URL of this CAP service, and additionally set the HTML5.ForwardAuthToken property. This allows you to consume the CAP service instead of the public Northwind service. The deployment of this CAP application also binds the CAP service to the XSUAA service already created by the managed-html5-runtime-fiori-mta package.
- Deploy the
managed-html5-runtime-fiori-mtato your BTP subaccount as explained in the package documentation. - Add the entitlement
hana hdi-sharedto your subaccount if you haven't done so already. - Build the project:
npm run build - Deploy in the same subaccount/space as the
managed-html5-runtime-fiori-mtapackage:cf deploy mta_archives/sample-northwind-cap.mtar
To make sure to use the new mock service, open an incognito browser window and access the URL of the HTML5 App of the managed-html5-runtime-fiori-mta package. You should see (almost) the same data as before, however the product name of the first product will be Hello from CAP - this is the mark that the data is read from the CAP service.
