examples/web/server.js
function html(req, res) {
  fs.readFile(path.join(__dirname, 'index.html'), function read(err, file) {
    if (err) throw err;

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

    res.end(file);
  });
}
function html(req, res) {
  fs.readFile(path.join(__dirname, 'index.html'), function read(err, file) {
    if (err) throw err;

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

    res.end(file);
  });
}
function html ( req , res ) { fs . readFile ( path . join ( __dirname , 'index.html' ) , function read ( err , file ) { if ( err ) throw err ; res . setHeader ( 'Content-Length' , file . length ) ; res . writeHead ( 200 , { 'Content-Type' : 'text/html' } ) ; res . end ( file ) ; } ) ; }
Serve the index.html

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