diff --git a/README.md b/README.md index 56f1d497..d0bfb5aa 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ Assign keys on Stream Deck or X-keys to playout actions. ## HTTP API -SuperConductor currently has a limited, internal, and unstable HTTP API. We plan to add a public and stable HTTP API with proper documentation in the future, but for now this internal API is available by default at `http://localhost:5500/api/internal`. The port can be changed by passing `--internal-http-api-port XXXX` as an argument to SuperConductor. This API can be disabled by passing the `--disable-internal-http-api` argument. +SuperConductor currently has a limited, internal, and unstable HTTP API. We plan to add a public and stable HTTP API with proper documentation in the future, but for now this internal API is available by default at `http://127.0.0.1:5500/api/internal`. The port can be changed by passing `--internal-http-api-port XXXX` as an argument to SuperConductor. This API can be disabled by passing the `--disable-internal-http-api` argument. Please be aware that, because this is an internal API, it may change at any time without notice. diff --git a/apps/app/src/electron/SuperConductor.ts b/apps/app/src/electron/SuperConductor.ts index aef88ef9..d7220c10 100644 --- a/apps/app/src/electron/SuperConductor.ts +++ b/apps/app/src/electron/SuperConductor.ts @@ -298,12 +298,12 @@ export class SuperConductor { this.analogHandler = new AnalogHandler(this.storage, this.bridgeHandler) this.analogHandler.on('error', (e) => this.log.error(e)) - if (this.disableInternalHttpApi) { - // TODO: now this becomes an API that also serves the contents of the Electron window - it should not be disabled - this.log.info(`Internal HTTP API disabled`) - } else { - this.httpAPI = new ApiServer(this.internalHttpApiPort, this.ipcServer, this.clientEventBus, this.log) - } + // TODO: this also serves the contents of the Electron window - it cannot be disabled + // if (this.disableInternalHttpApi) { + // this.log.info(`Internal HTTP API disabled`) + // } else { + this.httpAPI = new ApiServer(this.internalHttpApiPort, this.ipcServer, this.clientEventBus, this.log) + // } this._restoreTimelines() } diff --git a/apps/app/src/electron/api/ApiServer.ts b/apps/app/src/electron/api/ApiServer.ts index cc29a75e..07c2c4cd 100644 --- a/apps/app/src/electron/api/ApiServer.ts +++ b/apps/app/src/electron/api/ApiServer.ts @@ -104,8 +104,8 @@ export class ApiServer { // ---- end legacy code this.app - .listen(port) - .then(() => log.info('Feathers server listening on localhost:' + port)) + .listen(port, '127.0.0.1') + .then(() => log.info('Feathers server listening on 127.0.0.1:' + port)) .catch(log.error) } } diff --git a/apps/app/src/main.ts b/apps/app/src/main.ts index 86b88124..360138f9 100644 --- a/apps/app/src/main.ts +++ b/apps/app/src/main.ts @@ -59,7 +59,7 @@ function createWindow(log: winston.Logger, superConductor: SuperConductor): void // .catch((err) => log.info('An error occurred: ', err)) win.webContents.openDevTools() } - win.loadURL(isDev ? 'http://localhost:9124' : `file://${app.getAppPath()}/dist/index.html`).catch(log.error) + win.loadURL(isDev ? 'http://127.0.0.1:9124' : `file://${app.getAppPath()}/dist/index.html`).catch(log.error) const menuOpts = literal({ undoLabel: 'Undo', diff --git a/apps/app/src/react/components/pages/homePage/bridgesPage/NewBridgeDialog.tsx b/apps/app/src/react/components/pages/homePage/bridgesPage/NewBridgeDialog.tsx index f037b3eb..7f3774b7 100644 --- a/apps/app/src/react/components/pages/homePage/bridgesPage/NewBridgeDialog.tsx +++ b/apps/app/src/react/components/pages/homePage/bridgesPage/NewBridgeDialog.tsx @@ -45,7 +45,7 @@ export const NewBridgeDialog: React.FC<{ return ( => { }, }) - await win.loadURL(isDev ? 'http://localhost:9125' : `file://${app.getAppPath()}/dist/index.html`) + await win.loadURL(isDev ? 'http://127.0.0.1:9125' : `file://${app.getAppPath()}/dist/index.html`) storage.on('appData', (appData: AppData) => { ipcClient.settings(appData.settings) diff --git a/package.json b/package.json index e9e00a26..4124a40a 100644 --- a/package.json +++ b/package.json @@ -58,5 +58,6 @@ "ts-jest": "^29.0.5", "typescript": "^4.9.5" }, - "prettier": "@sofie-automation/code-standard-preset/.prettierrc.json" + "prettier": "@sofie-automation/code-standard-preset/.prettierrc.json", + "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" }