examples/web/server.js
function client(req, res) {
  const compiler = webpack(config);
  compiler.outputFileSystem = fsys;

  compiler.run((err, stats) => {
    const file = fsys.readFileSync(path.join(__dirname, 'dist', 'client.js'));

    res.setHeader('Content-Length', file.length);
    res.writeHead(200, { 'Content-Type': 'text/javascript' });

    res.end(file);
  });
}
function client(req, res) {
  const compiler = webpack(config);
  compiler.outputFileSystem = fsys;

  compiler.run((err, stats) => {
    const file = fsys.readFileSync(path.join(__dirname, 'dist', 'client.js'));

    res.setHeader('Content-Length', file.length);
    res.writeHead(200, { 'Content-Type': 'text/javascript' });

    res.end(file);
  });
}
function client ( req , res ) { const compiler = webpack ( config ) ; compiler . outputFileSystem = fsys ; compiler . run ( ( err , stats ) => { const file = fsys . readFileSync ( path . join ( __dirname , 'dist' , 'client.js' ) ) ; res . setHeader ( 'Content-Length' , file . length ) ; res . writeHead ( 200 , { 'Content-Type' : 'text/javascript' } ) ; res . end ( file ) ; } ) ; }
Serve the index.js client bundle.

@param {Request} req HTTP request.
@param {Response} res HTTP response.
@private
Serve the index . js client bundle .