title: Node express request call inside get
body: <p>I'm trying to use nodejs as a layer between my public website and a server on the inside of our network. </p>
  
  <p>I'm using express.js to create a simple REST api. The API endpoint should trigger a request call to a webservice, and return the result. </p>
  
  <p>But the request call inside my <code>.get()</code> function doesn't do anything.</p>
  
  <p>I want to return the result from the nested call to be returned.</p>
  
  <p>Code:</p>
  
  <pre><code>// Dependencies
  var express = require('express');
  var bodyParser = require('body-parser');
  var request = require('request');
  //Port
  var port = process.env.PORT || 8080;  
  
  // Express
  var app = express();
  app.use(bodyParser.urlencoded({extended: true}));
  app.use(bodyParser.json());
  
  
  // Routes
  app.get('/invoice', function(req, res){
     res.send('Express is workiung on IISNode')
  });
  
  
  app.get('/invoice/api/costumer=:customerId&amp;invoice=:invoiceId',  function(req, res){
         res.send('Customer ID: ' + req.params.customerId + ' Invoice ID: '+ req.params.invoiceId)
  
        var url = 'http://xxx/invapp/getinvoice?company='+req.params.customerId+'S&amp;customerno=13968&amp;invoiceno='+req.params.invoiceId+'';
        request('http://www.google.com', function (error, response, body) {
        res.send(body);
  
        })
  
  });
  
   // Start server
  app.listen(port);
  console.log("API is running on port " + port);
  </code></pre>
  
  <p>Any suggestions?</p>