fluxy-bot 0.2.14 → 0.2.16
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/package.json +1 -1
- package/supervisor/index.ts +7 -4
- package/vite.config.ts +6 -0
- package/vite.fluxy.config.ts +6 -0
package/package.json
CHANGED
package/supervisor/index.ts
CHANGED
|
@@ -74,10 +74,13 @@ export async function startSupervisor() {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
// Fluxy routes → proxy to fluxy Vite dev server
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
// Note: must check '/fluxy/' (with slash) to avoid matching '/fluxy_tilts.webm' etc.
|
|
78
|
+
if (req.url === '/fluxy' || req.url?.startsWith('/fluxy/')) {
|
|
79
|
+
// Rewrite bare /fluxy or /fluxy/ to /fluxy/fluxy.html — Vite dev defaults to index.html otherwise
|
|
80
|
+
const proxyPath = (req.url === '/fluxy' || req.url === '/fluxy/') ? '/fluxy/fluxy.html' : req.url;
|
|
81
|
+
console.log(`[supervisor] → fluxy Vite :${vitePorts.fluxy} | ${req.method} ${proxyPath}${proxyPath !== req.url ? ` (rewritten from ${req.url})` : ''}`);
|
|
79
82
|
const proxy = http.request(
|
|
80
|
-
{ host: '127.0.0.1', port: vitePorts.fluxy, path:
|
|
83
|
+
{ host: '127.0.0.1', port: vitePorts.fluxy, path: proxyPath, method: req.method, headers: req.headers },
|
|
81
84
|
(proxyRes) => {
|
|
82
85
|
res.writeHead(proxyRes.statusCode!, proxyRes.headers);
|
|
83
86
|
proxyRes.pipe(res);
|
|
@@ -211,7 +214,7 @@ export async function startSupervisor() {
|
|
|
211
214
|
}
|
|
212
215
|
|
|
213
216
|
// Route HMR WebSocket to correct Vite dev server
|
|
214
|
-
const isFluxy = req.url?.startsWith('/fluxy');
|
|
217
|
+
const isFluxy = req.url === '/fluxy' || req.url?.startsWith('/fluxy/');
|
|
215
218
|
const targetPort = isFluxy ? vitePorts.fluxy : vitePorts.dashboard;
|
|
216
219
|
console.log(`[supervisor] → Vite HMR (${isFluxy ? 'fluxy' : 'dashboard'}) :${targetPort}`);
|
|
217
220
|
|
package/vite.config.ts
CHANGED
package/vite.fluxy.config.ts
CHANGED