WebHandler
akka.grpc.scaladsl.WebHandler$
@ApiMayChange
object WebHandler
Attributes
- Source:
- WebHandler.scala
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Self type
- WebHandler.type
Members list
Concise view
Value members
Concrete methods
def grpcWebHandler(handlers: PartialFunction[HttpRequest, Future[HttpResponse]]*)(implicit as: ClassicActorSystemProvider, corsSettings: CorsSettings): HttpRequest => Future[HttpResponse]
Creates a HttpRequest
to HttpResponse
handler for gRPC services that can be used in
for example Http().bindAndHandleAsync
for the generated partial function handlers:
Creates a HttpRequest
to HttpResponse
handler for gRPC services that can be used in
for example Http().bindAndHandleAsync
for the generated partial function handlers:
- The generated handler supports the
application/grpc-web
andapplication/grpc-web-text
media types. - CORS is implemented for handled servives, including pre-flight requests and request enforcement.
- If the request is for a handled service, is not a CORS pre-flight request, and has an invalid media type, then a 415: Unsupported Media Type response is produced.
- Otherise if the request is not handled by one of the provided handlers, a 404: Not Found response is produced.
Attributes
- Source:
- WebHandler.scala
Concrete fields
Default CORS settings to use for grpc-web