MCPcopy Index your code
hub / github.com/coder/coder / createServer

Function createServer

site/e2e/helpers.ts:868–879  ·  view source on GitHub ↗
(
	port: number,
)

Source from the content-addressed store, hash-verified

866}
867
868export const createServer = async (
869 port: number,
870): Promise<ReturnType<typeof express>> => {
871 await waitForPort(port); // Wait until the port is available
872
873 const e = express();
874 // We need to specify the local IP address as the web server
875 // tends to fail with IPv6 related error:
876 // listen EADDRINUSE: address already in use :::50516
877 await new Promise<void>((r) => e.listen(port, "0.0.0.0", r));
878 return e;
879};
880
881async function waitForPort(
882 port: number,

Callers 2

Calls 2

waitForPortFunction · 0.85
listenMethod · 0.45

Tested by

no test coverage detected