MCPcopy Index your code
hub / github.com/webpack/webpack-dev-server / onBeforeSetupMiddleware

Function onBeforeSetupMiddleware

examples/util.js:31–45  ·  view source on GitHub ↗
({ app })

Source from the content-addressed store, hash-verified

29
30 const result = { ...defaults, ...config };
31 const onBeforeSetupMiddleware = ({ app }) => {
32 app.use("/.assets/", (req, res, next) => {
33 if (req.method !== "GET" && req.method !== "HEAD") {
34 next();
35 return;
36 }
37
38 res.setHeader("Content-Type", mime.lookup(req.url));
39
40 const filename = path.join(__dirname, "/.assets/", req.url);
41 const stream = fs.createReadStream(filename);
42
43 stream.pipe(res);
44 });
45 };
46 const renderer = new marked.Renderer();
47 const { heading } = renderer;
48 const markedOptions = {

Callers 1

setupFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…