fluxy-bot 0.12.2 → 0.12.3
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
CHANGED
package/supervisor/index.ts
CHANGED
|
@@ -341,7 +341,7 @@ export async function startSupervisor() {
|
|
|
341
341
|
|
|
342
342
|
// App API routes → proxy to user's backend server
|
|
343
343
|
if (req.url?.startsWith('/app/api')) {
|
|
344
|
-
const backendPath = req.url.replace(/^\/app
|
|
344
|
+
const backendPath = req.url.replace(/^\/app/, '');
|
|
345
345
|
console.log(`[supervisor] → backend :${backendPort} | ${req.method} ${backendPath}`);
|
|
346
346
|
if (!isBackendAlive()) {
|
|
347
347
|
console.log('[supervisor] Backend down — returning 503');
|
|
@@ -473,7 +473,7 @@ export async function startSupervisor() {
|
|
|
473
473
|
if (msg.type !== 'app:api' || !msg.data) return;
|
|
474
474
|
|
|
475
475
|
const { id, method, path: reqPath, headers: reqHeaders, body } = msg.data;
|
|
476
|
-
const backendPath = (reqPath || '').replace(/^\/app
|
|
476
|
+
const backendPath = (reqPath || '').replace(/^\/app/, '');
|
|
477
477
|
|
|
478
478
|
console.log(`[supervisor] App WS → backend :${backendPort} | ${method} ${backendPath} (${id})`);
|
|
479
479
|
|
package/vite.config.ts
CHANGED
|
@@ -260,16 +260,16 @@ Your working directory is the `workspace/` folder. This is your full-stack works
|
|
|
260
260
|
|
|
261
261
|
## Backend Routing (Critical)
|
|
262
262
|
|
|
263
|
-
A supervisor process sits in front of everything on port 3000. It strips the `/app
|
|
263
|
+
A supervisor process sits in front of everything on port 3000. It strips the `/app` prefix before forwarding to the backend, preserving the `/api/` path.
|
|
264
264
|
|
|
265
265
|
```
|
|
266
|
-
Browser: GET /app/api/tasks → Supervisor strips
|
|
266
|
+
Browser: GET /app/api/tasks → Supervisor strips /app → Backend receives: GET /api/tasks
|
|
267
267
|
```
|
|
268
268
|
|
|
269
269
|
**The rules:**
|
|
270
270
|
- **Frontend** fetch calls: use `/app/api/...`
|
|
271
|
-
- **Backend** Express routes: register as `/tasks`, `/health` —
|
|
272
|
-
-
|
|
271
|
+
- **Backend** Express routes: register as `/api/tasks`, `/api/health` — standard Express convention with `/api/` prefix
|
|
272
|
+
- The `/app` prefix is what distinguishes workspace backend routes from system routes
|
|
273
273
|
|
|
274
274
|
**Tunnel reliability:** All `/app/api/*` fetch calls from the dashboard are automatically proxied through WebSocket when available. This is transparent — just use `fetch('/app/api/...')` normally. The WebSocket proxy activates automatically and falls back to regular HTTP if unavailable. You don't need to handle this in your code.
|
|
275
275
|
|
|
@@ -367,6 +367,7 @@ There are TWO completely separate password systems in Fluxy. Understanding the d
|
|
|
367
367
|
POST /app/api/workspace/set-password
|
|
368
368
|
Body: { "password": "the_password" }
|
|
369
369
|
```
|
|
370
|
+
(The backend route is `/api/workspace/set-password` — the supervisor strips `/app` from the frontend URL.)
|
|
370
371
|
|
|
371
372
|
**How to remove it:**
|
|
372
373
|
```
|