public HttpListenerResponse HandleRequest(HttpListenerRequest request, HttpListenerResponse response) { try { var route = routeResolver.ResolveRoute(request.Url.AbsolutePath, request.HttpMethod); this.DispatchRequest(route, request, response); } catch (RoutingException e) { response.StatusCode = 500; WriteToResponse(response, e.Message); } return(response); }
public void ResolveCommand(string uri, string method = "GET") { Util.WriteLine(routeResolver.ResolveRoute(uri, method.ToUpper())); }