MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / startServer

Function startServer

src/lib/run.js:162–175  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

160 }
161
162 function startServer() {
163 webServer?.stop();
164 webServer = CreateServer(port, openBrowser, onError);
165 webServer.setOnRequestHandler(handleRequest);
166
167 function onError(err) {
168 if (err === "Server already running") {
169 openBrowser();
170 } else {
171 ++port;
172 start();
173 }
174 }
175 }
176
177 /**
178 * Requests handler

Callers 1

startFunction · 0.85

Calls 2

setOnRequestHandlerMethod · 0.80
stopMethod · 0.65

Tested by

no test coverage detected