Skip to content

Commit

Permalink
Fix server-side rendering for App Bridge v4
Browse files Browse the repository at this point in the history
  • Loading branch information
paulomarg committed May 6, 2024
1 parent 5ac73c6 commit 97aff25
Showing 1 changed file with 5 additions and 1 deletion.
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 97aff25

Please sign in to comment.