title: Returning Json with nodeJS
body: <p>I try to learn nodeJS and AngularJS using Clash of clan API available here <code>https://developer.clashofclans.com/#/</code></p>
  
  <p>My JSON api's return is truncated and i don't know how get the full response.</p>
  
  <p>there is my app.js wrinting with node and express : </p>
  
  <pre><code>var   express       = require('express')
  , https         = require('https')
  , bodyParser    = require('body-parser')
  , request       = require('request')
  , app           = express()
  , http_port     = 3000;
  
  app.use(express.static(__dirname + '/public'));
  app.use(bodyParser());
  
  var options = {
      host: 'api.clashofclans.com',
      port: 443,
      path: '/v1/clans/' + encodeURIComponent("#PP8JC9RQ"),
      headers : {
      accept : "application/json",
      authorization : "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiIsImtpZCI6IjI4YTMxOGY3LTAwMDAtYTFlYi03ZmExLTJjNzQzM2M2Y2NhNSJ9.eyJpc3MiOiJzdXBlcmNlbGwiLCJhdWQiOiJzdXBlcmNlbGw6Z2FtZWFwaSIsImp0aSI6ImQ4Njg1OGFhLWQzZTUtNDNiOC05MTM1LTBjNzI1ZjI4OGFiMiIsImlhdCI6MTQ1NjMwMTE5MSwic3ViIjoiZGV2ZWxvcGVyLzk1YWM0YjdmLTY5NTQtMDE3MC01ZjAyLTcxNjY1ZDMzYjUwNyIsInNjb3BlcyI6WyJjbGFzaCJdLCJsaW1pdHMiOlt7InRpZXIiOiJkZXZlbG9wZXIvc2lsdmVyIiwidHlwZSI6InRocm90dGxpbmcifSx7ImNpZHJzIjpbIjg3LjIzMS4yMTMuMTU0Il0sInR5cGUiOiJjbGllbnQifV19.SYqeSAF-0_bM1eS2-hnovvj5j-I0SQpdr_kySIiBKw9OkrNuBzZAOAOkiH3fzdKSkcHaJfXzWdXr8JozFfAmJA"
  },
  method: 'GET'
  };
  
  //  Route par défaut
      app.get("/members", function(req, res) {
      console.log("-------------------------------------\n\nroot path !! Let's get clan infos from coc api\n\n-------------------------------------");
      var req = https.request(options, function(response){
  
          response.on('data', function (chunk) {          
              console.log('BODY: ' + chunk);
              //    in console JSON is full but in my html JSON is truncated..
              res.send(chunk);
          });         
      });
  
      req.on('error', function(e) {
          console.log('problem with request: ' + e.message);
      });
  
      req.end();
  
      });
  
  
  app.listen(http_port,function(){
      console.log("Listening on " + http_port);
  });
  </code></pre>
  
  <p>If someone can teach to a nook :)</p>