Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
I am beginner in shopify app development.
I created an app by this guide (nodejs)
I added my custom script by this scripttag api
My app has some settings for my script which can be changed by the merchant. These settings are saved in db.
When my script loads i want to get these settings.
For example:
// server side app.post('/settings', (req, res) => { res.json({}); });
// storefront script fetch('https://xxx.eu.ngrok.io/settings', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ shop: window.Shopify.shop }) }).then(() => {});
How can I get these setting from my app db in storefront?
Solved! Go to the solution
This is an accepted solution.
I found the answer
It is proxy
I moved to theme-app-extension
This page helped me
But the proxy did not work the first time. I was getting a 404 error
I hit the wall for a long time
The answer is shopify sometimes does not update proxy. I do not understand why. So i did this a few times without code change and it was my award.
I hope this information helps someone
This is an accepted solution.
I found the answer
It is proxy
I moved to theme-app-extension
This page helped me
But the proxy did not work the first time. I was getting a 404 error
I hit the wall for a long time
The answer is shopify sometimes does not update proxy. I do not understand why. So i did this a few times without code change and it was my award.
I hope this information helps someone