bonzai-tree 1.0.118 → 1.0.120
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -57,6 +57,8 @@ if (terminalHandlers) {
|
|
|
57
57
|
// Catch-all for SPA routing - serve HTML shell for any non-API route
|
|
58
58
|
app.get('*', (req, res) => {
|
|
59
59
|
const repoName = path.basename(ROOT);
|
|
60
|
+
const host = req.get('X-Forwarded-Host') || req.get('Host') || `localhost:${port}`;
|
|
61
|
+
const protocol = req.get('X-Forwarded-Proto') || 'http';
|
|
60
62
|
res.send(`<!DOCTYPE html>
|
|
61
63
|
<html>
|
|
62
64
|
<head>
|
|
@@ -73,7 +75,7 @@ app.get('*', (req, res) => {
|
|
|
73
75
|
<div id="root"></div>
|
|
74
76
|
<script>
|
|
75
77
|
window.BONZAI_REPO = "${repoName}";
|
|
76
|
-
window.BONZAI_API = "
|
|
78
|
+
window.BONZAI_API = "${protocol}://${host}";
|
|
77
79
|
</script>
|
|
78
80
|
<script src="https://bonzai.dev/app.js"></script>
|
|
79
81
|
</body>
|