lib/routes/associations.js
function retrieveAssociations(req, res) {
  switch(req.accepts(['json', 'html'])) {
    // TODO: support HTML in future
    //case 'html':
    //  res.sendFile(path.resolve(__dirname + '/../../web/association.html'));
    //  break;
    default:
      var rootUrl = req.protocol + '://' + req.get('host');
      var queryPath = req.originalUrl;
      req.chickadee.getAssociations(req, rootUrl, queryPath,
                                    function(response, status) {
        res.status(status).json(response);
      });
      break;
  }
}
function retrieveAssociations(req, res) {
  switch(req.accepts(['json', 'html'])) {
    // TODO: support HTML in future
    //case 'html':
    //  res.sendFile(path.resolve(__dirname + '/../../web/association.html'));
    //  break;
    default:
      var rootUrl = req.protocol + '://' + req.get('host');
      var queryPath = req.originalUrl;
      req.chickadee.getAssociations(req, rootUrl, queryPath,
                                    function(response, status) {
        res.status(status).json(response);
      });
      break;
  }
}
function retrieveAssociations ( req , res ) { switch ( req . accepts ( [ 'json' , 'html' ] ) ) { // TODO: support HTML in future //case 'html': //  res.sendFile(path.resolve(__dirname + '/../../web/association.html')); //  break; default : var rootUrl = req . protocol + '://' + req . get ( 'host' ) ; var queryPath = req . originalUrl ; req . chickadee . getAssociations ( req , rootUrl , queryPath , function ( response , status ) { res . status ( status ) . json ( response ) ; } ) ; break ; } }
Retrieve all available associations.
@param {Object} req The HTTP request.
@param {Object} res The HTTP result.
Retrieve all available associations .