joi-router.js
function makeFormBodyParser(spec) {
  const opts = spec.validate.formOptions || {};
  if (typeof opts.limit === 'undefined') {
    opts.limit = spec.validate.maxBody;
  }
  return async function parseFormBody(ctx, next) {
    if (!ctx.request.is('urlencoded')) {
      return ctx.throw(400, 'expected x-www-form-urlencoded');
    }
    ctx.request.body = ctx.request.body || await parse.form(ctx, opts);
    await next();
  };
}
function makeFormBodyParser(spec) {
  const opts = spec.validate.formOptions || {};
  if (typeof opts.limit === 'undefined') {
    opts.limit = spec.validate.maxBody;
  }
  return async function parseFormBody(ctx, next) {
    if (!ctx.request.is('urlencoded')) {
      return ctx.throw(400, 'expected x-www-form-urlencoded');
    }
    ctx.request.body = ctx.request.body || await parse.form(ctx, opts);
    await next();
  };
}
function makeFormBodyParser ( spec ) { const opts = spec . validate . formOptions || { } ; if ( typeof opts . limit === 'undefined' ) { opts . limit = spec . validate . maxBody ; } return async function parseFormBody ( ctx , next ) { if ( ! ctx . request . is ( 'urlencoded' ) ) { return ctx . throw ( 400 , 'expected x-www-form-urlencoded' ) ; } ctx . request . body = ctx . request . body || await parse . form ( ctx , opts ) ; await next ( ) ; } ; }
Creates form body parser middleware.

@param {Object} spec
@return {async function}
@api private
Creates form body parser middleware .