question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Topic "Create a Northwind Destination": Proper neo-app.json Setting Missing

See original GitHub issue

The 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:closed
  • Created 5 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Michadeliccommented, Mar 30, 2019

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 the neo-app.json:

{
  "welcomeFile": "index.html",
  "routes": [
    {
       
      "path": "/resources",
      "target": {
        "type": "service",
        "name": "sapui5",
        "version": "snapshot",
        "entryPath": "/resources"
      },
      "description": "SAPUI5 Resources"
    },
    {
      "path": "/test-resources",
      "target": {
        "type": "service",
        "name": "sapui5",
        "entryPath": "/test-resources"
      },
      "description": "SAPUI5 Test Resources"
    }*HIGHLIGHT START*,
    {
      "path": "/destinations/northwind",
      "target": {
        "type": "destination",
        "name": "northwind"
      },
      "description": "Northwind OData Service"
    }*HIGHLIGHT END*
  ]
}

webapp/manifest.json

In the app descriptor, the service URL is then defined relative to the destination path specified above:

...
"sap.app": {
 "dataSources": {
   "": {
     "uri": "*HIGHLIGHT START*/destinations/northwind/V2/Northwind/Northwind.svc/*HIGHLIGHT END*",
     "type": "OData",
     "settings": {
       "odataVersion": "2.0"
     }
   }
 }
}
...

Thanks again for your patience and for reporting all the details in this issue - it is appreciated!

All the best, Michael

0reactions
boghyoncommented, Mar 17, 2019

From Slack:

Hi guys. In SAPUI5 SDK page, in the page for topic ‘create northwind destination’, the code sample doesn’t show the new code regarding the explanation above the code sample box.

Read more comments on GitHub >

github_iconTop Results From Across the Web

destination not working from neo-app.json after deploying ...
I followed the steps as given in the document to create neo-app.json and map it to the destination created in HCP cockpit ....
Read more >
Consume a third party library through a Destionation in Sap ...
I require the library in the manifest and set up the routing in neo-app.json but the library is still missing in my consuming...
Read more >
Create a neo-app.json Project Configuration File - SAPUI5 SDK
The neo-app.json file contains all project settings for SAP Web IDE and is created in the root folder of your project. It is...
Read more >
SAPUI5: UI Development Toolkit for HTML5
Create a neo-app.json Project Configuration File ... (local) service beginning with /destinations/northwind/*, the created destination ...
Read more >
fiori-tools - npm Package Health Analysis - Snyk
Also it requires separate backend host definition for each of rules while neo-app.json supports destinations. How to use: declare middleware in ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found