MCPcopy
hub / github.com/forwardemail/superagent / getSetup

Function getSetup

test/support/setup.js:9–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7let uri;
8
9async function getSetup() {
10 if (NODE && uri) {
11 return { NODE, uri };
12 }
13
14 NODE = true;
15 if (typeof window !== 'undefined') {
16 NODE = false;
17 uri = `//${window.location.host}`;
18 } else {
19 try {
20 const port = await getPort();
21
22 // check that another call to the function hasn't set the uri already
23 if (!uri) {
24 process.env.ZUUL_PORT = port;
25 uri = `http://localhost:${process.env.ZUUL_PORT}`;
26 require('./server');
27 }
28 } catch (err) {
29 console.error(err);
30 }
31 }
32
33 return { NODE, uri };
34}
35
36module.exports = getSetup;

Callers 15

redirects.jsFile · 0.85
retry.jsFile · 0.85
basic.jsFile · 0.85
content-type.jsFile · 0.85
form.jsFile · 0.85
timeout.jsFile · 0.85
json.jsFile · 0.85
request.jsFile · 0.85
agent-base.jsFile · 0.85
use.jsFile · 0.85
redirects.jsFile · 0.85
not-modified.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected