Package io.muserver

Class Routes

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static MuHandler route​(Method method, java.lang.String uriTemplate, RouteHandler muHandler)
      Creates a new handler that will only be called if it matches the given route info.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • route

        public static MuHandler route​(Method method,
                                      java.lang.String uriTemplate,
                                      RouteHandler muHandler)
        Creates a new handler that will only be called if it matches the given route info.
        Parameters:
        method - The method to match, or null to accept any method.
        uriTemplate - A URL template. Supports plain URLs like /abc or paths with named parameters such as /abc/{id} or named parameters with regexes such as /abc/{id : [0-9]+} where the named parameter values can be accessed with the pathParams parameter in the route handler.
        muHandler - The handler to invoke if the method and URI matches.
        Returns:
        Returns a MuHandler that is only called if the request URI and method matches.
        See Also:
        MuServerBuilder.addHandler(Method, String, RouteHandler)