Node.js Get the Curent URL and Params

In your server code use the following to display the current URL and params.

// API / GET
exports.get = function( req, res ) {

     var fullUrl = req.protocol + '://' + req.get('host') + req.originalUrl;
     res.send(fullUrl);
     return true;

}

display the current URL and params.

Or you can display the headers of the request like this:

// API / GET
exports.get = function( req, res ) {

      res.send(JSON.stringify(req.headers));
     return true;

}

display the headers of the request

Then to extract the params do the following.

exports.getFeed = function( req, res ) {

  if (req.param("token")) {
     token = req.param("token");
  }
 else {
     res.send( 'No access token provided.' );  
 }

}