MCPcopy Create free account
hub / github.com/BrasilAPI/BrasilAPI / waitForWebServer

Function waitForWebServer

tests/helpers/server/setup.js:16–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14
15 async function waitForAllServices() {
16 async function waitForWebServer() {
17 return retry(
18 async (bail, tries) => {
19 if (tries >= 25) {
20 /* eslint-disable no-console */
21 console.log(
22 `> Trying to connect to Webserver #${tries}. Are you running the server with "npm run dev"?`
23 );
24 }
25 await fetch(`${host}/api/status/v1`);
26 },
27 {
28 retries: 50,
29 minTimeout: 10,
30 maxTimeout: 1000,
31 factor: 1.1,
32 }
33 );
34 }
35
36 await waitForWebServer();
37 }

Callers 1

waitForAllServicesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected