Skip to content

Commit

Permalink
Merge pull request #1327 from Shopify/app_bridge_v4_replace_api_key
Browse files Browse the repository at this point in the history
Fix server-side rendering for App Bridge v4
  • Loading branch information
paulomarg authored Aug 21, 2024
2 parents b20283d + 4028bfe commit 864edba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion web/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ app.use("/*", shopify.ensureInstalledOnShop(), async (_req, res, _next) => {
return res
.status(200)
.set("Content-Type", "text/html")
.send(readFileSync(join(STATIC_PATH, "index.html")));
.send(
readFileSync(join(STATIC_PATH, "index.html"))
.toString()
.replace("%VITE_SHOPIFY_API_KEY%", process.env.SHOPIFY_API_KEY || "")
);
});

app.listen(PORT);

0 comments on commit 864edba

Please sign in to comment.