Add flipper-server-companion to flipper-server
Summary: Start flipper-server-companion whenever a client connects to flipper-server and sets `server_companion` query parameter in a connection URL to true Reviewed By: mweststrate Differential Revision: D36098169 fbshipit-source-id: eb953e7d680b30aef1340f059264112387264c05
This commit is contained in:
committed by
Facebook GitHub Bot
parent
a6d7f98cfd
commit
b4498f070f
@@ -18,6 +18,7 @@ import {startWebServerDev} from './startWebServerDev';
|
||||
import yargs from 'yargs';
|
||||
import open from 'open';
|
||||
import {sleep} from 'flipper-common';
|
||||
import {initCompanionEnv} from 'flipper-server-companion';
|
||||
|
||||
const argv = yargs
|
||||
.usage('yarn flipper-server [args]')
|
||||
@@ -88,6 +89,7 @@ async function start() {
|
||||
argv.settingsString,
|
||||
argv.launcherSettings,
|
||||
);
|
||||
const companionEnv = await initCompanionEnv(flipperServer);
|
||||
if (argv.failFast) {
|
||||
flipperServer.on('server-state', ({state}) => {
|
||||
if (state === 'error') {
|
||||
@@ -100,7 +102,7 @@ async function start() {
|
||||
if (argv.bundler) {
|
||||
await startWebServerDev(app, server, socket, rootDir);
|
||||
}
|
||||
startSocketServer(flipperServer, socket);
|
||||
startSocketServer(flipperServer, socket, companionEnv);
|
||||
}
|
||||
|
||||
start()
|
||||
|
||||
Reference in New Issue
Block a user