play.core
creates a Server implementation based Netty
Cake for building a simple Netty server.
The Netty server provider
Create a Netty server from the given router and server config:
val server = Netty.fromRouter(ServerConfig(port = Some(9002))) { case GET(p"/") => Action { Results.Ok("Hello") } }
Or from a given router using BuiltInComponents:
val server = NettyServer.fromRouterWithComponents(ServerConfig(port = Some(9002))) { components => import play.api.mvc.Results._ import components.{ defaultActionBuilder => Action } { case GET(p"/") => Action { Ok("Hello") } } }
Use this together with Sird Router.
Create a Netty server from the given router and server config:
Or from a given router using BuiltInComponents:
Use this together with Sird Router.