**** Route maps a URI to a method handler. All uri's are treated as case-insensitive.** ** All handler classes are [autobuilt]`afIoc::Registry.autobuild`. If the class is 'const', the ** instance is cached for future use.** ** Nicked and adapted form 'draft'**constclass Route {** The URI this route matches. Always starts and ends with a slash.const Uri routeBase** Method handler for this route. const Method handler** HTTP method used for this routeconst Str httpMethodprivateconst Str[] matchingPathstaticnew wotever(){return Route(``,#match)}new make(Uri routeBase, Method handler, Str httpMethod := "GET"){if(!routeBase.isPathOnly)throw BedSheetErr(BsMsgs.routeShouldBePathOnly(routeBase))if(!routeBase.isPathAbs)throw BedSheetErr(BsMsgs.routeShouldStartWithSlash(routeBase))this.routeBase = routeBase.plusSlashthis.httpMethod = httpMethod.upperthis.handler = handlerthis.matchingPath = routeBase.path.map {it.lower }}** Match this route against the request arguments, returning a list of Str arguments. Returns** 'null' if no match.internal RouteMatch? match(Uri uri, Str httpMethod){if(httpMethod != this.httpMethod)returnnull uriPath := uri.pathif(uriPath.isEmpty)// we don't match '/', instead we route to a welcome pagereturnnull actualBase := ``// need to build up the actualBase for a case-insensitive Uri.relTo() match := matchingPath.all |path, i| { actualBase = actualBase.plusSlash.plusName(uriPath[i])return path == uriPath[i].lower}if(!match)returnnull rel:= uri.relTo(actualBase)return RouteMatch(routeBase, rel, httpMethod, handler)}}