1
votes

I'm trying to setup a local development environment for SAPUI5. For that I followed this guide which is referring to this NPM plugin

I added the plugin into my project, but I keep getting 401 responses when performing OData requests. Naturally, a text editor doesn't have the Destinations section from the SAP Cloud Platform. How can I setup a proxy that can behave in a similar fashion?

1
we can only guess, since we dont know your "config/build.json". have you configured your server? Is is a local one? is it reachable in the browser? - Medera
The "Destinations" section in the SAP Cloud platform acts as a proxy, allowing the application to make cross-domain requests. Ideally I would like to configure such a proxy, providing the credentials for my Gateway server so I could reach it out. - Marco Hernández
If you configure configs/build.json as hinted by Medera above, the proxy is started when running gulp. - rikusv
Oh, I thought that config was for deploying only. Will try to set this file and see if I can make OData calls, thanks! - Marco Hernández
Believe you need to download the SCP SDK and create a tunnel to your SCP account - Chris Neve

1 Answers

0
votes

You need to maintain your SAP Gateway system in configs/build.json. For example (from the ui5-toolkit documentation):

{
    "sap": {
        "nwbc": {
            "protocol": "http",
            "server": "myServer.com",
            "port": "80",
            "bspContainer": "ZZ_WORKLIST_TEM",
            "bspContainerText": "ZZ_Worklist_template",
            "package": "$TMP",
            "transport": null
        }
    }
}

The proxy for that backend should then be started when running gulp.

Please note that there are other options too. For example, see grunt-openui5 and UI5 Build and Development Tooling .