lib/render.js
function renderComponent(req, res, hrStart) {
  var extension = getExtension(req), // Get the extension for the request
    renderer = findRenderer(extension), // Determine which renderer we are using
    _ref = req.uri,
    locals = res.locals,
    options = options || {};

  if (renderer instanceof Error) {
    log('error', renderer);
    return Promise.reject(renderer);
  }
  // Add request route params, request query params
  // and the request extension to the locals object
  locals.params = req.params;
  locals.query = req.query;
  locals.extension = extension;

  return components.get(_ref, locals)
    .then(cmptData => formDataForRenderer(cmptData, { _ref }, locals))
    .tap(logTime(hrStart, _ref))
    .then(({data, options}) => renderer.render(data, options, res))
    .catch(err => log('error', err));
}
function renderComponent(req, res, hrStart) {
  var extension = getExtension(req), // Get the extension for the request
    renderer = findRenderer(extension), // Determine which renderer we are using
    _ref = req.uri,
    locals = res.locals,
    options = options || {};

  if (renderer instanceof Error) {
    log('error', renderer);
    return Promise.reject(renderer);
  }
  // Add request route params, request query params
  // and the request extension to the locals object
  locals.params = req.params;
  locals.query = req.query;
  locals.extension = extension;

  return components.get(_ref, locals)
    .then(cmptData => formDataForRenderer(cmptData, { _ref }, locals))
    .tap(logTime(hrStart, _ref))
    .then(({data, options}) => renderer.render(data, options, res))
    .catch(err => log('error', err));
}
function renderComponent ( req , res , hrStart ) { var extension = getExtension ( req ) , // Get the extension for the request renderer = findRenderer ( extension ) , // Determine which renderer we are using _ref = req . uri , locals = res . locals , options = options || { } ; if ( renderer instanceof Error ) { log ( 'error' , renderer ) ; return Promise . reject ( renderer ) ; } // Add request route params, request query params // and the request extension to the locals object locals . params = req . params ; locals . query = req . query ; locals . extension = extension ; return components . get ( _ref , locals ) . then ( cmptData => formDataForRenderer ( cmptData , { _ref } , locals ) ) . tap ( logTime ( hrStart , _ref ) ) . then ( ( { data , options } ) => renderer . render ( data , options , res ) ) . catch ( err => log ( 'error' , err ) ) ; }
Render a component via whatever renderer should be used

@param  {Object} req
@param  {Object} res
@param  {Object} hrStart
@return {Promise}
Render a component via whatever renderer should be used