title: Pipe mutiple api calls to cient with node/express/request
body: <p>I have a web app for the steam api that is working fine with a single server side api call. But I would like to pipe two or more api calls to the client. Currently the below code works, how do I send second_json to the client?</p>
  
  <pre><code>var express = require('express');
  var request = require('request');
  var app = express();
  
  function proxy() {
      app.use('/', function(req, res) {
          var sid = req.query.sid[1].trim();
          var url ="http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=[APIKEY]&amp;steamids=";
          var url2 ="http://api.steampowered.com/ISteamUser/ResolveVanityURL/v0001/?key=[APIKEY]&amp;vanityurl=";
          var url3 =  "http://api.steampowered.com/IPlayerService/GetRecentlyPlayedGames/v0001/?key=[APIKEY]&amp;steamid=";
          res.header("Access-Control-Allow-Origin", "*");
          res.header("Access-Control-Allow-Headers","Origin, X-Requested-With, Content-Type, Accept");
          request(url2 + sid, function(error, response, body) {
              var newid = JSON.parse(body).response.steamid
              if (newid !== undefined) {
                  sid = newid;
              }
              request(url3+sid+"&amp;format=json", function(err, resp, result){
                 var second_json = result;
                 req.pipe(request(url + sid)).pipe(res);
              })
          });
      });
  }
  proxy();
  app.listen(process.env.PORT || 3000);
  </code></pre>