html webpage doesn't render properly.

Not applicable

I have created a proxy for a sap backend url on Apigee OPDK . When we make a call to the proxy from browser , the page rendered doesn't contain buttons and other images . Kindly let me know what is causing this issue. The page displays properly when we type the sap backend url directly on browser.

0 5 4,518
5 REPLIES 5

If you have specified a relative path for JavaScript, CSS or image resources in your HTML file, they won't get rendered when you proxy them via Apigee. As they don't reside in Apigee, the page fails to load these resources. You can confirm that by checking the JavaScript Console tab under "Developer tools" of your browser.

Hi @sudheendra1

Thanks , i guessed so . Do let me know how to resolve this problem.

Sure... Can you tell why you want to proxy HTML pages through Apigee? What's your use case? This will help me understand the problem better.

Not applicable

If you are going to proxy a web resource you will need to proxy all of the assets referenced in that web resource as well. Every image, every JS file, every CSS resource, everything. This typically is not a use case that Apigee is used for - of course you could easily do it - you just have to set the right base paths and use a pass through for those assets.

There is a workaround I used and worked:

On the HTML page:

  1. I moved all my resources (.css, .js ...) to a folder called "resources"
  2. Used <base href="https://community.apigee.com/resources/"> tag in html page so I can load my javascript with relevant path in resource folder (<script src="js/app.js" ></script>)

On Apigee:
  1. Created an endpoint called "resources" with similar target endpoint as the main website.
  2. Modified the response and replaced the <base href="https://community.apigee.com/resources/"> with something that matches my resource endpoint path.

With this approach your proxy will recieve multiple calls when you load a page, one for loading the page and a few more depending on the number of resources you load on the page.

Please let me know if you need more details or have questions