Hi all –
I’ve been following Shopify’s guide for creating a post-purchase upsell extension (https://shopify.dev/docs/apps/checkout/product-offers/post-purchase/getting-started) and I’m curious if the extension can publish API routes that can be called externally, like from a landing page hosted with Hydrogen & Oxygen?
For example, in the guide I linked, you end up creating routes for “/api/offer” and “/api/sign-changeset”, which are called by the frontend of the app so that some backend tasks can be completed. That makes perfect sense to me and it works as intended.
However, when I tried creating a /api/hello-world route, it works fine for local testing, but when I deploy the app to production via the Partner Dashboard, I can no longer hit that route because a) I don’t know what the URL of the cloudflare worker is and b) requests don’t seem to be redirected from the primary store’s main URL (i.e. storename.myshopify.com/api/hello-world).
What am I missing here? Is there a way to discover what the published URL of your cloudflare worker is? Or am I misunderstanding how the routing / redirection is supposed to work?