Memory Profiling For Mere Mortals

Server

Toys

function onrequest(req, res) {
  var context = getContext(req);

  fs.readFile(path.join(__dirname, index.html), utf8, function onreadIndex(err, src) {
    if (err) return console.error(err)
    var html = header + templateEngine(src, context)
    serve(html)
  })
}
  • resources like context and src of index.html are created for each request