function serveFile(path, mime, res) {
  fs.readFile(path, function (err, contents) {
    if (err) {
      console.log("err: 500");
      console.error(err);
      res.status(err).sendStatus(500);
    } else {
      res.set('Content-Type', mime).send(contents);
    }
  });
}
/*
  Serve a file from disk with the given mimetype
  res: serve throught this response object
*/
Serve a file from disk with the given mimetype
res: serve throught this response object
Serve a file from disk with the given mimetype res : serve throught this response object
function serveFile(path, mime, res) {
  fs.readFile(path, function (err, contents) {
    if (err) {
      console.log("err: 500");
      console.error(err);
      res.status(err).sendStatus(500);
    } else {
      res.set('Content-Type', mime).send(contents);
    }
  });
}
function serveFile ( path , mime , res ) { fs . readFile ( path , function ( err , contents ) { if ( err ) { console . log ( "err: 500" ) ; console . error ( err ) ; res . status ( err ) . sendStatus ( 500 ) ; } else { res . set ( 'Content-Type' , mime ) . send ( contents ) ; } } ) ; }
Serve a file from disk with the given mimetype
res: serve throught this response object
Serve a file from disk with the given mimetype res : serve throught this response object