const classdraft::Route

sys::Obj
  draft::Route

Route models how a URI pattern gets routed to a method handler. Example patterns:

Pattern         Uri           Args
--------------  ------------  ----------
"/"             `/`           [:]
"/foo/{bar}"    `/foo/12`     ["bar":"12"]
"/foo/*"        `/foo/x/y/z`  [:]
"/foo/{bar}/*"  `/foo/x/y/z`  ["bar":"x"]
handler

Source

const Method handler

Method handler for this route. If this method is an instance method, a new intance of the parent type is created before invoking the method.

make

Source

new make(Str pattern, Str method, Method handler)

Constructor.

match

Source

[Str:Str]? match(Uri uri, Str method)

Match this route against the request arguments. If route can be be matched, return the pattern arguments, or return null for no match.

method

Source

const Str method

HTTP method used for this route.

pattern

Source

const Str pattern

URI pattern for this route.

toStr

Source

virtual override Str toStr()

toStr is pattern.