MCPcopy Create free account
hub / github.com/ICBNetwork/web3-Wallet / createStaticServer

Function createStaticServer

e2e/create-static-server.js:6–20  ·  view source on GitHub ↗
(rootDirectory)

Source from the content-addressed store, hash-verified

4import serveHandler from 'serve-handler';
5
6const createStaticServer = function (rootDirectory) {
7 return http.createServer((request, response) => {
8 if (request.url.startsWith('/node_modules/')) {
9 request.url = request.url.substr(14);
10 return serveHandler(request, response, {
11 directoryListing: false,
12 public: path.resolve('./node_modules'),
13 });
14 }
15 return serveHandler(request, response, {
16 directoryListing: false,
17 public: rootDirectory,
18 });
19 });
20};
21
22export default createStaticServer;

Callers 1

withFixturesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected