MCPcopy Create free account
hub / github.com/Fibi66/FeiControl / requestRuntime

Function requestRuntime

scripts/dev-server.cjs:69–95  ·  view source on GitHub ↗
(host, port, requestPath, method = 'GET')

Source from the content-addressed store, hash-verified

67}
68
69function requestRuntime(host, port, requestPath, method = 'GET') {
70 return new Promise((resolve, reject) => {
71 const request = http.request(
72 {
73 hostname: host,
74 port,
75 path: requestPath,
76 method,
77 },
78 (response) => {
79 const chunks = [];
80 response.on('data', (chunk) => {
81 chunks.push(chunk);
82 });
83 response.on('end', () => {
84 resolve({
85 statusCode: response.statusCode ?? 0,
86 body: Buffer.concat(chunks).toString('utf8'),
87 });
88 });
89 }
90 );
91
92 request.on('error', reject);
93 request.end();
94 });
95}
96
97function extractStaticAssetPath(html) {
98 const match = html.match(/\/_next\/static\/[^"' )]+/);

Callers 1

runPublicSmokeCheckFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected