Equals :meth:`route` with a ``PATCH`` method parameter.
352533
def patch(self, path=None, method='PATCH', **options):
        
        return self.route(path, method, **options)
456347
function(router, target) {
    // By default, just patch the router's own methods.
    // If a target is given, then patch the router to call the target's methods
    target = target || router;

    // get(setting), which is different than get(path, fn)
    var get = router.get;

    // Wrap all of these methods to convert Swagger-style paths to Express-style paths
    var fns = {};
    ['use', 'route', 'all'].concat(swaggerMethods).forEach(function(method) {
      fns[method] = target[method];
      router[method] = function(path) {
        var args = _.drop(arguments, 0);

        // Special-case for `app.get(setting)`
        if (args.length === 1 && method === 'get') {
          return get.call(router, path);
        }

        // Convert Swagger-style path to Express-style path
        if (_.isString(path)) {
          args[0] = path.replace(util.swaggerParamRegExp, ':$1');
        }

        // Pass-through to the corresponding Express method
        var ret = fns[method].apply(target, args);

        if (router.__sortMiddleWare) {
          router.__sortMiddleWare();
        }

        return ret;
      };
    });
  }
601390
public Router patch(@NotNull final String pattern, @NotNull final IMiddleware... handlers) {
        addPattern("PATCH", pattern, handlers, patchBindings);
        return this;
    }
917179
public RouteMatcher patchWithRegEx(String regex, Handler<HttpServerRequest> handler) {
		addRegEx(regex, handler, patchBindings);
		return this;
	}
292630
function patch(ctx) {
    const statusMethods = Object.assign({}, opts.statusMethods, statusCodeMap)
    ctx.send = respond.bind(ctx, ctx)

    // Bind status methods.
    for (const method in statusMethods) {
      const code = statusMethods[method]
      ctx[method] = respond.bind(ctx, ctx, code)
    }

    // Bind other methods
    const methods = Object.assign({}, opts.methods)
    for (const method in methods) {
      const fn = methods[method]
      ctx[method] = fn.bind(ctx, ctx)
    }

    return ctx
  }
868802
function route(method, path, handler, config) {

    if( (typeof method !== 'string' && !Array.isArray(method))
        || (typeof path !== 'string')
        || (typeof handler !== 'function' && typeof handler !== 'string' && typeof handler !== 'object')
        || (config != null && typeof config !== 'object') ) {
        throw new TypeError('Bad arguments');
    }

    if (typeof method === 'string') {
        method = method.toUpperCase().replace(/\s+/g, ' ').trim().replace(/^DEL$/, 'DELETE');
        if (method.match(/ /)) {
            method = method.split(' ');
        }
    }
    if (Array.isArray(method)) {
        method = method.map(function (x) {
            return x.toUpperCase().replace(/\s+/g, ' ').trim().replace(/^DEL$/, 'DELETE');
        });
        method.forEach(function (elem) {
            if (elem.match(/[^A-Z*]/)) {
                throw new TypeError('Bad arguments');
            }
        });
    }
    return {
        method: method,
        path: path,
        handler: handler,
        config: config
    };
}
993886
def add_patch(self, path: str, handler: _WebHandler,
                  **kwargs: Any) -> AbstractRoute:
        
        return self.add_route(hdrs.METH_PATCH, path, handler, **kwargs)
1174339
function replaceWith(to, params, query) {
    this.context.router.replaceWith(to, params, query);
  }
441258
def _add_route(self, method, path, middleware=None):
        """"""
        if middleware is not None:
            self.add(method, path, middleware)
            return self
        else:
            # return a lambda that will return the 'func' argument
            return lambda func: (
                self.add(method, path, func),
                func
            )[1]
979596
def _route_match( self, method_name, path_info, route_table ):
        
        path = path_info['path']

        for route_path, route_info in route_table.items():
            if method_name not in route_info['routes'].keys():
                continue

            grps = re.match(route_path, path)
            if grps is None:
                continue

            groups = grps.groups()
            return {
                'route': route_info,
                'method': route_info['routes'][method_name],
                'args': groups,
            }

        return None
496041
function EvalRoute (ctx, next) {
	let router = this;
	let matched = router.match(router.opts.routerPath || ctx.routerPath || ctx.path, ctx.method);
	/* istanbul ignore else */
	if (ctx.matched) {
		ctx.matched.push.apply(ctx.matched, matched.path);
	} else {
		ctx.matched = matched.path;
	}
	if (matched.route) {
		return this.middleware()(ctx, next);
	} else {
		return Promise.resolve('koaton-no-route');
	}
}
838362
function match (route) {
  assert.equal(typeof route, 'string')

  return route.trim()
    .replace(/[\?|#].*$/, '')
    .replace(/^(?:https?\:)\/\//, '')
    .replace(/^.*?(\/.*)/, '$1')
    .replace(/\/$/, '')
}
1263920
def route(method, pattern, handler=None):
    
    if handler is None:
        return partial(route, method, pattern)
    return routes.append(method, pattern, handler)
173594
function router(req, resp, next) {
    const routerPath = req.routePath || '';

    const beforeRunMiddleware = (route) => {
      const match = matchRoute(routerPath, req, route);
      if (!match) return false;

      const { params, path: matchPath } = match;

      if (options.params) req.params = { ...options.params, ...params };
      else req.params = params;

      // dynamically set req.routePath for the route
      req.routePath = routerPath + matchPath;
      return true;
    };
    const routeStack = compose(router.routes, { beforeRunMiddleware });

    return routeStack.call(this, req, resp, () => {
      req.routePath = routerPath;// restore routePath
      return next && next();
    });
  }
1144548
function fixRoute(route) {
	
	//protect special chars while we replace
	return route.replace(/\s*OR\s*/g,'__OR__').
	replace(/\s*->\s*/g,'__->__').
	replace(/[\s\t\n]+/g,'/').
	replace(/__/g,' ');
}
816027
def match(self, method, path):
        
        segments = path.split('/')
        while len(segments):
            index = '/'.join(segments)
            if index in self.__idx__:
                handler, params = self.match_rule(method, path,
                                                  self.__idx__[index])
                if handler:
                    return handler, params
            segments.pop()
        return None, None
438798
public RouteMatcher patch(String pattern, Handler<HttpServerRequest> handler) {
		addPattern(pattern, handler, patchBindings);
		return this;
	}