Beispiel #1
0
        public void AddEndpoint(string endpoint, AsyncEndpointHandler callback, HashSet <HttpMethod> methods)
        {
            if (!(endpoint.StartsWith("/") || endpoint == "*"))
            {
                throw new ArgumentException("Endpoint path must start with slash or be a catch-all one (*)");
            }

            var route = Router.CompileRoute(endpoint);

            route.Methods = methods;
            Endpoints.Add(route, new EndpointDefinition(endpoint, callback));
        }
Beispiel #2
0
 public static extern unsafe void ice_server_set_async_endpoint_cb(
     CoreServer *server,
     AsyncEndpointHandler cb
     );
Beispiel #3
0
 public void AddGETEndpoint(string endpoint, AsyncEndpointHandler callback) => AddEndpoint(endpoint, callback, new HashSet <HttpMethod>()
 {
     HttpMethod.Get
 });
Beispiel #4
0
 public EndpointDefinition(string endpoint, AsyncEndpointHandler callback)
 {
     Endpoint = endpoint;
     Callback = callback;
 }