title: Function callback in Node.js
body: <p>I'm new to Node.JS and I'm trying to callback a function and then display acc_token value on the web-page, but what I'm getting is "ReferenceError: acc_token is not defined at Object.handle". </p>
  
  <p>Here is my code</p>
  
  <pre><code>app.get('/code/', function(request, response, callback) {
  var code = request.query.code;
  unirest.post('https://url/access_token')
  .headers({
    'Accept': 'application/json'
  })
  .send({
    client_id: "#",
    client_secret: "#",
    code: code,
    redirect_uri: "#"
  })
  .end(function endReq(response, request) {
    parsedRes = response.body;
    acc_token = parsedRes.access_token
    console.log("Access token is:" + acc_token);
    return callback(acc_token);
  });
  
  response.send("Hello, " + code + "." + acc_token);
  //
  });
  </code></pre>
  
  <p>Any help is appreciated.</p>