MCPcopy Index your code
hub / github.com/NativeScript/SimDeck / startServer

Function startServer

scripts/integration/webrtc.mjs:148–183  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

146}
147
148function startServer() {
149 killPortListeners(serverPort);
150 serverProcess = spawn(
151 simdeck,
152 [
153 "service",
154 "run",
155 "--metadata-path",
156 path.join(tempRoot, "service.json"),
157 "--port",
158 String(serverPort),
159 "--bind",
160 "127.0.0.1",
161 "--client-root",
162 path.join(root, "packages", "client", "dist"),
163 "--access-token",
164 serverAccessToken,
165 "--video-codec",
166 "software",
167 "--stream-quality",
168 "full",
169 "--local-stream-fps",
170 "60",
171 ],
172 {
173 cwd: tempRoot,
174 stdio: ["ignore", "pipe", "pipe"],
175 },
176 );
177 serverProcess.stdout.on("data", (data) =>
178 process.stdout.write(`[service] ${data}`),
179 );
180 serverProcess.stderr.on("data", (data) =>
181 process.stderr.write(`[service] ${data}`),
182 );
183}
184
185async function waitForHealth() {
186 const deadline = Date.now() + 30_000;

Callers 1

mainFunction · 0.70

Calls 1

killPortListenersFunction · 0.70

Tested by

no test coverage detected