Topic "Create a Northwind Destination": Proper neo-app.json Setting Missing
See original GitHub issueThe topic Create a Northwind Destination ends with:
With this configuration you can use the destination for any app inside SAP Web IDE. Whenever an app calls a (local) service beginning with
/destinations/northwind/*
, the created destination becomes active as a simple proxy. This helps to prevent any possible issues related to the same-origin policy of browsers.
And that’s it.
It’s missing a link between neo-app.json and the destination created in SCP, leaving the reader out in the cold. If the prefix "/destinations/northwind/"
is not added to the "routes"
inside the neo-app.json, the app won’t be able to fetch any data from the service. That information, however, is not mentioned in the topic.
There is the previous topic Create neo-app.json Project Configuration File, but that doesn’t include the destination created in SCP but only the basic route to get the UI5 resources.
What is the expected result?
The topic Create a Northwind Destination guides the reader into adding the corresponding route to the neo-app.json appropriately, just like in the topic Request Fails Due to Same-Origin Policy (Cross-Origin Resource Sharing - CORS):
neo-app.json
…
{ "routes": [ { "path": "/destinations/northwind", "target": { "type": "destination", "name": "northwind" }, "description": "Northwind OData Service" } ] }
…
manifest.json
"sap.app": { "dataSources": { "invoiceRemote": { "uri": "/destinations/northwind/V2/Northwind/Northwind.svc/", "type": "OData", "settings": { "odataVersion": "2.0" } } } },
Or at least a link to “the next step”, where adding the route is mentioned, would be great.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (6 by maintainers)
Top GitHub Comments
Hello @boghyon,
i made sure that those code blocks are now appearing in the documentation according to your feedback and are marked properly using our highlighting syntax of the demo kit.
It will be first visible here on openui5nighly, once our UA colleagues approved the change: https://openui5nightly.hana.ondemand.com/#/topic/3a16c7a2f1e944deb000db49e5ece6be
here is a sneak preview for your convenience 😃
neo-app.json
With this configuration you can use the destination for any app inside SAP Web IDE. Whenever an app calls a (local) service beginning with
/destinations/northwind/*
, the created destination becomes active as a simple proxy. This helps to prevent any possible issues related to the same-origin policy of browsers. For this, you need to add another route to theneo-app.json
:webapp/manifest.json
In the app descriptor, the service URL is then defined relative to the destination path specified above:
Thanks again for your patience and for reporting all the details in this issue - it is appreciated!
All the best, Michael
From Slack: