Skip to content

Commit d36ecd8

Browse files
Merge remote-tracking branch 'origin/final_changes' into release_BC
2 parents 5d99236 + bc5739b commit d36ecd8

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ The internal web server binds to **all network interfaces** (`0.0.0.0`) by defau
9797
- Use the full path including the trailing slash: `/gui/` (e.g. `http://localhost:5500/gui/`) so assets load correctly.
9898
- The Web UI uses the same API and WebSocket connection as the desktop app; the machine running SuperConductor must be reachable on port `5500` from the browser.
9999
- CORS is configured to allow browser clients from any origin; the API and real-time updates work when the browser is on another machine.
100+
- **Development (`yarn start` from repo root):** The Web UI is served from the built frontend in the `build` folder. That folder is created when you run **`yarn build`** (from the repo root). If you only run `yarn start` without building first, `/gui/` will return 404 until you run `yarn build` once. This applies on all platforms (including Windows).
100101

101102
## HTTP API
102103

apps/app/src/electron/api/ApiServer.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import fs from 'fs'
12
import path from 'path'
23
import { EverythingService } from '../EverythingService.js'
34
import { LoggerLike } from '@shared/api'
@@ -100,11 +101,22 @@ export class ApiServer {
100101
{
101102
let guiUrlPath: string
102103
if (app.isPackaged) {
103-
// In production/packaged mode, build folder is in the app path
104104
guiUrlPath = path.resolve(app.getAppPath(), 'build')
105105
} else {
106-
// In development mode, build folder is relative to app path
107-
guiUrlPath = path.resolve(app.getAppPath(), '../build')
106+
// In development: Vite outputs to <app>/build. Prefer app path, fallback to cwd (e.g. Windows + yarn start).
107+
const appPathBuild = path.resolve(app.getAppPath(), 'build')
108+
const cwdBuild = path.resolve(process.cwd(), 'build')
109+
guiUrlPath =
110+
fs.existsSync(appPathBuild) && fs.statSync(appPathBuild).isDirectory()
111+
? appPathBuild
112+
: fs.existsSync(cwdBuild) && fs.statSync(cwdBuild).isDirectory()
113+
? cwdBuild
114+
: appPathBuild
115+
if (!fs.existsSync(guiUrlPath) || !fs.statSync(guiUrlPath).isDirectory()) {
116+
log.warn(
117+
`Web GUI build folder not found at ${guiUrlPath}. Run "yarn build" (or "vite build" in apps/app) once to enable the Web UI at /gui/`
118+
)
119+
}
108120
}
109121

110122
// Add redirect from /gui to /gui/ for proper asset loading (must be before static serving)

0 commit comments

Comments
 (0)