路由 OPTION 请求 $path 到 $handler
@param string $path
@param callable $handler
@return RouterInterface
325209
public function option($path, callable $handler): RouterInterface
    {
        $ruler = $this->createRuler('OPTION', $path);
        return $this->addRuler($ruler, $handler);
    }
40186
public Javalin get(@NotNull String path, @NotNull Handler handler) {
        return addHandler(HandlerType.GET, path, handler);
    }
1260470
private static function createMiddlewareFromClosure(Closure $handler): MiddlewareInterface
    {
        return new class($handler) implements MiddlewareInterface {
            private $handler;

            public function __construct(Closure $handler)
            {
                $this->handler = $handler;
            }

            public function process(ServerRequestInterface $request, RequestHandlerInterface $next): ResponseInterface
            {
                return call_user_func($this->handler, $request, $next);
            }
        };
    }
519946
public function any($route, $handler)
    {
        return $this->addRoute(new Route($this->router, ['GET', 'HEAD', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'], $route, $handler, $this->name));
    }
1008075
public function map($method, $path, $handler)
    {
        $path = sprintf('/%s', ltrim($path, '/'));

        $route = (new Route)->setMethods((array) $method)
        ->setPath($path)->setCallable($handler);

        $this->routes[$path] = $route;

        return $route;
    }
671848
public static function patch($path, $handlerMethod = null)
    {
        return self::factory($path, HttpMethods::PATCH, $handlerMethod);
    }
30576
public function put($path, callable $handler): RouterInterface
    {
        $ruler = $this->createRuler('PUT', $path);
        return $this->addRuler($ruler, $handler);
    }
532344
public function put(string $path, $handler)
  {
    return $this->request($path, Request::HTTP_PUT, $handler);
  }
245429
private function registerRoute(string $path, $handler, array $option = [])
    {
        $path = '/' . \trim($path, '/ ');

        $this->routes[$path] = [
            'handler' => $handler,
            'option' => $option
        ];
    }
604843
public Javalin delete(@NotNull String path, @NotNull Handler handler) {
        return addHandler(HandlerType.DELETE, path, handler);
    }
1369356
public Javalin post(@NotNull String path, @NotNull Handler handler) {
        return addHandler(HandlerType.POST, path, handler);
    }
2697
protected function dispatchRoute(
        RouteHandlerInterface $handler,
        ServerRequestInterface $request,
        Closure $next = null
    ): ResponseInterface {
        // callback that will be passed to the route handler call, as last argument.
        $handlerNext = $next ? function ($newRequest = null) use ($next, $request) {
            return $next($newRequest instanceof ServerRequestInterface ? $newRequest : $request);
        } :
            function () {
                // noop
            };
        return $handler($handlerNext);
    }
55014
public static function get($route, $handler, $options = [])
    {
        app()->router->get($route, $handler, $options);
    }
446012
public function options(String $path, Callable $callback) : Route {

		return $this->collectRoute('OPTIONS', $path, $callback);

	}
207765
public function map($method, $route, $handler)
    {
        $this['router']->map($method, $route, $handler);

        return $this;
    }
400629
public function any(string $path, $handler, array $pathParams = [], array $opts = []): void
    {
        $this->map(self::METHODS_ARRAY, $path, $handler, $pathParams, $opts);
    }
297730
public function get(string $path, $handler, array $pathParams = [], array $opts = []): Route
    {
        return $this->add('GET', $path, $handler, $pathParams, $opts);
        // return $this->map(['GET', 'HEAD'], $path, $handler, $pathParams, $opts);
    }