on 02-19-2019 7:50 PM
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"
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 ...:
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
72 | |
8 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.