cancel
Showing results for 
Search instead for 
Did you mean: 

"neo-app.json" file when creating a new SAPUI5 project in Web IDE

After I Created a new SAPUI5 project in Web IDE, I created the file "neo-app.json" and copy the code from UI5 Demo Kit.

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

They mentioned that "The path and the entryPath values will point to the location on the server where the SAPUI5 resources will be stored."

How can I decide the path that I need in my own projects? How can I see the folds in the SAPUI5 server to decide which resource I need? What is the meaning of "path" and "target"

michal_keidar
Active Contributor
0 Kudos

Hi Boghyon,

I am no longer PM for Web IDE. I can suggest you to contact the team at sapwebide@sap.com.

Regards,
Michal.

Accepted Solutions (1)

Accepted Solutions (1)

boghyon
Product and Topic Expert
Product and Topic Expert

The following documentation topics from SAP Web IDE explain the purpose of neo-app.json and how it can be configured:

The copied code you mentioned in the question is required to access UI5 resources from Web IDE rather than from e.g. CDN.

The "path" in the route will be used as a hook for Web IDE to redirect the request internally (reverse proxy) to the registered destination, service, or application whenever the URL "/resources/..." is to be resolved within the application runtime.

For example, let's say we have the following route:

"routes": [{
  "path": "/myResources",
  "target": {
    "type": "service",
    "name": "sapui5",
    "entryPath": "/resources"
  }
}]

Notice the "path": "/myResources" in the route. Then in index.html:

<script id="sap-ui-bootstrap" src="/myResources/sap-ui-core.js" ...>

As soon as the request is sent, Web IDE ...:

  1. Redirects the request internally (not visible to the client) to the "entryPath" of the service "sapui5" (entryPath "/resources" replaces the custom path "/myResources")
  2. And then navigates to the rest of the URL ("/sap-ui-core.js") returning the requested resources.

The client just sees the following request URL (e.g. in the network trace):

https://webidecp-<user>.dispatcher.hanatrial.ondemand.com/myResources/sap-ui-core.js

But internally, Web IDE requests:

https://sapui5-sapui5.dispatcher.hana.ondemand.com/resources/sap-ui-core.js

This explains the neo-app.json route

Resulting in https://sapui5-sapui5.dispatcher.hana.ondemand.com/resources/sap-ui-core.js <-- UI5 resources requested via src="/myResources/sap-ui-core.js".

For more information, please check the documentation mentioned above.

Otherwise, here is another example that shows how to register Northwind OData service as a destination in SCP and make use of it in Web IDE: https://answers.sap.com/answers/705030/view.html

0 Kudos

Very clear. Thank you very much!

Answers (0)