MCPcopy Index your code
hub / github.com/react/react / createHTTP2Server

Function createHTTP2Server

scripts/bench/server.js:18–42  ·  view source on GitHub ↗
(benchmark)

Source from the content-addressed store, hash-verified

16}
17
18function createHTTP2Server(benchmark) {
19 const server = http2Server.createServer({}, (request, response) => {
20 const filename = join(
21 __dirname,
22 'benchmarks',
23 benchmark,
24 request.url
25 ).replace(/\?.*/g, '');
26
27 if (existsSync(filename) && statSync(filename).isFile()) {
28 sendFile(filename, response);
29 } else {
30 const indexHtmlPath = join(filename, 'index.html');
31
32 if (existsSync(indexHtmlPath)) {
33 sendFile(indexHtmlPath, response);
34 } else {
35 response.writeHead(404);
36 response.end();
37 }
38 }
39 });
40 server.listen(8080);
41 return server;
42}
43
44function createHTTPServer() {
45 const server = httpServer.createServer({

Callers 1

serveBenchmarkFunction · 0.85

Calls 1

sendFileFunction · 0.85

Tested by

no test coverage detected