title: Node js response.end
body: <p>I have a little problem with that ...</p>
  
  <pre><code> var server = http.createServer(function (req, res, data) {
      var url = 'http://localhost:11918/api/log';
  
      http.get(url, function (res) {
          var body = '';
          res.on('data', function (chunk) {
              body += chunk;
          });
          res.on('end', function () {
              var data = JSON.parse(body);           
              Data.emit('JsData', data);
          });
      }).on('error', function (e) {
          console.log("Got an error: ", e);
      });    
  
      Data.on('JsData', function (message) {
          res.writeHead(200, { "Content-Type": "text/plain" });
          res.write(JSON.stringify(message));
          res.end();
      });
  });
  </code></pre>
  
  <p>Error: write after end</p>
  
  <p>it 's nice but it is possible to rewrite several times on the server .... ?
  and how ?</p>