fluxy-bot 0.12.2 → 0.12.4

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluxy-bot",
3
- "version": "0.12.2",
3
+ "version": "0.12.4",
4
4
  "releaseNotes": [
5
5
  "Adding a way for users to claim their fluxies on the fluxy.bot dashboard",
6
6
  "2. ",
@@ -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\/api/, '') || '/';
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\/api/, '') || '/';
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
@@ -25,7 +25,7 @@ export default defineConfig({
25
25
  proxy: {
26
26
  '/app/api': {
27
27
  target: 'http://localhost:3004',
28
- rewrite: (path) => path.replace(/^\/app\/api/, '') || '/',
28
+ rewrite: (path) => path.replace(/^\/app/, ''),
29
29
  },
30
30
  '/api': 'http://localhost:3000',
31
31
  },
@@ -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/api` prefix before forwarding to the backend.
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 prefix → Backend receives: GET /tasks
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` — NO `/app/api` prefix
272
- - No exceptions
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
  ```
@@ -28,7 +28,7 @@ const app = express();
28
28
  app.use(express.json());
29
29
 
30
30
  // Health check
31
- app.get('/health', (_req, res) => {
31
+ app.get('/api/health', (_req, res) => {
32
32
  res.json({ status: 'ok' });
33
33
  });
34
34