index.js
function factory(options) {
  options = applyOptions(options);

  return (ctx, next) => {

    // Next if secure
    if (options.resolver(ctx)) {
      return next();
    }
    // Redirect to HTTPS
    else {
      redirect(options, ctx);
    }
  }
}
function factory(options) {
  options = applyOptions(options);

  return (ctx, next) => {

    // Next if secure
    if (options.resolver(ctx)) {
      return next();
    }
    // Redirect to HTTPS
    else {
      redirect(options, ctx);
    }
  }
}
enforceHTTPS

@param    {Hash}       options
@param    {Function}   options[resolver]
@param    {Integer}    options[port]
@param    {String}     options[hostname]
@param    {Boolean}    options[ignoreUrl]
@param    {Boolean}    options[temporary]
@param    {Array}      options[redirectMethods]
@param    {Integer}    options[disallowStatus]
@return   {Function}
@api      public