bonzai-tools 1.0.103 → 1.0.105
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.
- package/dist/bconfig.js +1 -1
- package/dist/graph-templates/receiver.js +26 -26
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/bconfig.js
CHANGED
|
@@ -14,32 +14,6 @@ const server = http.createServer(app);
|
|
|
14
14
|
app.use(cors());
|
|
15
15
|
app.use(express.json());
|
|
16
16
|
|
|
17
|
-
// Embed shell - loads app from CDN
|
|
18
|
-
app.get('/', (req, res) => {
|
|
19
|
-
const repoName = path.basename(ROOT);
|
|
20
|
-
res.send(`<!DOCTYPE html>
|
|
21
|
-
<html>
|
|
22
|
-
<head>
|
|
23
|
-
<meta charset="UTF-8">
|
|
24
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
25
|
-
<title>Bonzai - ${repoName}</title>
|
|
26
|
-
<link rel="stylesheet" href="https://bonzai.dev/app.css">
|
|
27
|
-
<style>
|
|
28
|
-
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
29
|
-
html, body, #root { height: 100%; }
|
|
30
|
-
</style>
|
|
31
|
-
</head>
|
|
32
|
-
<body>
|
|
33
|
-
<div id="root"></div>
|
|
34
|
-
<script>
|
|
35
|
-
window.BONZAI_REPO = "${repoName}";
|
|
36
|
-
window.BONZAI_API = "http://localhost:${port}";
|
|
37
|
-
</script>
|
|
38
|
-
<script src="https://bonzai.dev/app.js"></script>
|
|
39
|
-
</body>
|
|
40
|
-
</html>`);
|
|
41
|
-
});
|
|
42
|
-
|
|
43
17
|
// Health check
|
|
44
18
|
app.get('/health', (req, res) => {
|
|
45
19
|
const repoName = path.basename(ROOT);
|
|
@@ -80,6 +54,32 @@ if (terminalHandlers) {
|
|
|
80
54
|
app.get('/terminal', terminalHandlers.terminalHandler);
|
|
81
55
|
}
|
|
82
56
|
|
|
57
|
+
// Catch-all for SPA routing - serve HTML shell for any non-API route
|
|
58
|
+
app.get('*', (req, res) => {
|
|
59
|
+
const repoName = path.basename(ROOT);
|
|
60
|
+
res.send(`<!DOCTYPE html>
|
|
61
|
+
<html>
|
|
62
|
+
<head>
|
|
63
|
+
<meta charset="UTF-8">
|
|
64
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
65
|
+
<title>Bonzai - ${repoName}</title>
|
|
66
|
+
<link rel="stylesheet" href="https://bonzai.dev/app.css">
|
|
67
|
+
<style>
|
|
68
|
+
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
69
|
+
html, body, #root { height: 100%; }
|
|
70
|
+
</style>
|
|
71
|
+
</head>
|
|
72
|
+
<body>
|
|
73
|
+
<div id="root"></div>
|
|
74
|
+
<script>
|
|
75
|
+
window.BONZAI_REPO = "${repoName}";
|
|
76
|
+
window.BONZAI_API = "http://localhost:${port}";
|
|
77
|
+
</script>
|
|
78
|
+
<script src="https://bonzai.dev/app.js"></script>
|
|
79
|
+
</body>
|
|
80
|
+
</html>`);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
83
|
server.listen(port, () => {
|
|
84
84
|
console.log('File server running on http://localhost:' + port);
|
|
85
85
|
});
|
package/dist/index.js
CHANGED
|
@@ -161,7 +161,7 @@ async function main() {
|
|
|
161
161
|
BONZAI_REPO_DIR: currentDir
|
|
162
162
|
}
|
|
163
163
|
});
|
|
164
|
-
exec("open http://localhost:3001");
|
|
164
|
+
exec("open http://localhost:3001/visualize?ref=btools");
|
|
165
165
|
server.on("close", (serverCode) => {
|
|
166
166
|
console.log(`
|
|
167
167
|
Server stopped with code ${serverCode}`);
|