Function tonic_web::enable

source ·
pub fn enable<S>(service: S) -> CorsGrpcWeb<S>
where S: Service<Request<Body>, Response = Response<BoxBody>> + Clone + Send + 'static, S::Future: Send + 'static, S::Error: Into<Box<dyn Error + Send + Sync>> + Send,
Expand description

Enable a tonic service to handle grpc-web requests with the default configuration.

You can customize the CORS configuration composing the GrpcWebLayer with the cors layer of your choice.