Beispiel #1
0
        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);
            }
        }
Beispiel #2
0
 public void AddRoute(APIRoute route)
 {
     _routes.Add(route);
 }