lib/routes/contextat.js
function retrieveContextAtReceiver(req, res) {
  if(redirect(req.params.id, '', '', res)) {
    return;
  }

  switch(req.accepts(['json', 'html'])) {
    case 'html':
      res.sendFile(path.resolve(__dirname + '/../../web/response.html'));
      break;
    default:
      var options = {
        query: 'receivedStrongestBy',
        id: req.params.id,
        omit: [ 'timestamp' ] }; 
      var rootUrl = req.protocol + '://' + req.get('host');
      var queryPath = req.originalUrl;
      req.chickadee.getDevicesContext(req, options, rootUrl, queryPath,
                                      function(response, status) {
        res.status(status).json(response);
      });
      break;
  }
}
function retrieveContextAtReceiver(req, res) {
  if(redirect(req.params.id, '', '', res)) {
    return;
  }

  switch(req.accepts(['json', 'html'])) {
    case 'html':
      res.sendFile(path.resolve(__dirname + '/../../web/response.html'));
      break;
    default:
      var options = {
        query: 'receivedStrongestBy',
        id: req.params.id,
        omit: [ 'timestamp' ] }; 
      var rootUrl = req.protocol + '://' + req.get('host');
      var queryPath = req.originalUrl;
      req.chickadee.getDevicesContext(req, options, rootUrl, queryPath,
                                      function(response, status) {
        res.status(status).json(response);
      });
      break;
  }
}
function retrieveContextAtReceiver ( req , res ) { if ( redirect ( req . params . id , '' , '' , res ) ) { return ; } switch ( req . accepts ( [ 'json' , 'html' ] ) ) { case 'html' : res . sendFile ( path . resolve ( __dirname + '/../../web/response.html' ) ) ; break ; default : var options = { query : 'receivedStrongestBy' , id : req . params . id , omit : [ 'timestamp' ] } ; var rootUrl = req . protocol + '://' + req . get ( 'host' ) ; var queryPath = req . originalUrl ; req . chickadee . getDevicesContext ( req , options , rootUrl , queryPath , function ( response , status ) { res . status ( status ) . json ( response ) ; } ) ; break ; } }
Retrieve the context at a given receiver device id.
@param {Object} req The HTTP request.
@param {Object} res The HTTP result.
Retrieve the context at a given receiver device id .