diff --git a/frontend/src/api/index.ts b/frontend/src/api/index.ts index 89bd40f6..2108bfa4 100644 --- a/frontend/src/api/index.ts +++ b/frontend/src/api/index.ts @@ -1,36 +1,34 @@ /** * Resolves the backend base URL. * - * Everywhere except the Google Docs sidebar a relative `/api` works (Word's dev - * server and the production web host both serve the API under the same origin). + * Whatever origin served this bundle also serves the backend API, so we + * discover it at runtime instead of baking it in at build time — one built + * image is deployed to both staging and production, and a compile-time + * constant would send the staging sidebar to the production backend. * - * The Google Docs sidebar is different: its HTML is served from a Google origin, - * so a relative `/api` would hit Google's domain instead of the backend: + * The Google Docs sidebar is the case that needs the script tag: the page + * itself is on a Google origin, but `sidebar.html` injects our bundle as a + * classic