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)); }
public static extern unsafe void ice_server_set_async_endpoint_cb( CoreServer *server, AsyncEndpointHandler cb );
public void AddGETEndpoint(string endpoint, AsyncEndpointHandler callback) => AddEndpoint(endpoint, callback, new HashSet <HttpMethod>() { HttpMethod.Get });
public EndpointDefinition(string endpoint, AsyncEndpointHandler callback) { Endpoint = endpoint; Callback = callback; }