public void Router(HttpListenerRequest request, HttpListenerResponse response) { string[] matches; APIRoute route = RouteMatch(request, out matches); if (route == null) { APIServer.SetResponse(response, HttpStatusCode.NotFound, ""); } else { route.Handler(request, matches, response); } }
public void AddRoute(APIRoute route) { _routes.Add(route); }