Rename and documentation for start dev server (attach)
Summary: Same as with the previous diff. The function doesn't really start a server. Instead it attaches the routing of messages from the existing server into FlipperServer. Reviewed By: passy Differential Revision: D36310703 fbshipit-source-id: 7ac9a742fb36c3806597382c9aadcf96f4770484
This commit is contained in:
committed by
Facebook GitHub Bot
parent
582966d139
commit
242d26e199
@@ -26,7 +26,12 @@ import {
|
|||||||
} from 'flipper-server-companion';
|
} from 'flipper-server-companion';
|
||||||
import {URLSearchParams} from 'url';
|
import {URLSearchParams} from 'url';
|
||||||
|
|
||||||
export function startSocketServer(
|
/**
|
||||||
|
* Attach and handle incoming messages from clients.
|
||||||
|
* @param flipperServer A FlipperServer instance.
|
||||||
|
* @param socket A ws socket on which to listen for events.
|
||||||
|
*/
|
||||||
|
export function attachSocketServer(
|
||||||
flipperServer: FlipperServerImpl,
|
flipperServer: FlipperServerImpl,
|
||||||
socket: WebSocketServer,
|
socket: WebSocketServer,
|
||||||
companionEnv: FlipperServerCompanionEnv,
|
companionEnv: FlipperServerCompanionEnv,
|
||||||
@@ -12,7 +12,7 @@ import chalk from 'chalk';
|
|||||||
import path from 'path';
|
import path from 'path';
|
||||||
import {startFlipperServer} from './startFlipperServer';
|
import {startFlipperServer} from './startFlipperServer';
|
||||||
import {startServer} from './startServer';
|
import {startServer} from './startServer';
|
||||||
import {startSocketServer} from './startSocketServer';
|
import {attachSocketServer} from './attachSocketServer';
|
||||||
import {attachDevServer} from './attachDevServer';
|
import {attachDevServer} from './attachDevServer';
|
||||||
|
|
||||||
import yargs from 'yargs';
|
import yargs from 'yargs';
|
||||||
@@ -102,7 +102,7 @@ async function start() {
|
|||||||
if (argv.bundler) {
|
if (argv.bundler) {
|
||||||
await attachDevServer(app, server, socket, rootDir);
|
await attachDevServer(app, server, socket, rootDir);
|
||||||
}
|
}
|
||||||
startSocketServer(flipperServer, socket, companionEnv);
|
attachSocketServer(flipperServer, socket, companionEnv);
|
||||||
}
|
}
|
||||||
|
|
||||||
start()
|
start()
|
||||||
|
|||||||
Reference in New Issue
Block a user