1 2var fs = require('fs'); 3 4require('http').createServer(function (req, res) { 5 res.writeHead(200, {'Content-Type': 'text/plain'}); 6 var a = 'world'; 7 res.write('hello', 'utf8', function() { 8 a = 'blah'; 9 fs.appendFile('callback', '', function() {}); 10 }); 11 res.end(a); 12}).listen(7080); 13