lib/routes/whatat.js
function retrieveWhatAtTransmitter(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: 'receivedBy',
        req: req,
        ids: [req.params.id]
      };
      var rootUrl = req.protocol + '://' + req.get('host');
      var queryPath = req.originalUrl;
      req.barterer.getDevicesState(options, rootUrl, queryPath,
                                   function(response, status) {
        res.status(status).json(response);
      });
      break;
  }
}
function retrieveWhatAtTransmitter(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: 'receivedBy',
        req: req,
        ids: [req.params.id]
      };
      var rootUrl = req.protocol + '://' + req.get('host');
      var queryPath = req.originalUrl;
      req.barterer.getDevicesState(options, rootUrl, queryPath,
                                   function(response, status) {
        res.status(status).json(response);
      });
      break;
  }
}
function retrieveWhatAtTransmitter ( 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 : 'receivedBy' , req : req , ids : [ req . params . id ] } ; var rootUrl = req . protocol + '://' + req . get ( 'host' ) ; var queryPath = req . originalUrl ; req . barterer . getDevicesState ( options , rootUrl , queryPath , function ( response , status ) { res . status ( status ) . json ( response ) ; } ) ; break ; } }
Retrieve what is decoded by a specific receiver device.
@param {Object} req The HTTP request.
@param {Object} res The HTTP result.
Retrieve what is decoded by a specific receiver device .