Solved

Get compiled html page through API

Mato1
Visitor
2 0 0

Is there any way I could get compiled html through API? I have generated json data in html and I would like to fetch that on outside server, and because CORS I'm unable to do that so I'm looking for a backup solution.

Accepted Solution (1)

HunkyBill
Shopify Expert
4845 60 547

This is an accepted solution.

Install an App in the store. When you setup the configuration of that App, you can add an App Proxy. Your App will listen for calls to an endpoint your App services. Shopify will then securely call your App to that endpoint, and you can return HTML to the store, where Shopify will render it into the DOM and the customer will see your HTML. You can add Liquid tags to the HTML on your server, and Shopify will also fill in the Liquid, making this a very powerful pattern when used.

The reason you have CORS problems is because you cannot call external websites from Shopify.

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com

View solution in original post

Reply 1 (1)

HunkyBill
Shopify Expert
4845 60 547

This is an accepted solution.

Install an App in the store. When you setup the configuration of that App, you can add an App Proxy. Your App will listen for calls to an endpoint your App services. Shopify will then securely call your App to that endpoint, and you can return HTML to the store, where Shopify will render it into the DOM and the customer will see your HTML. You can add Liquid tags to the HTML on your server, and Shopify will also fill in the Liquid, making this a very powerful pattern when used.

The reason you have CORS problems is because you cannot call external websites from Shopify.

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com