play.core.server

Members list

Packages

Type members

Classlikes

A convenient helper trait for constructing an PekkoHttpServer, for example:

A convenient helper trait for constructing an PekkoHttpServer, for example:

 val components = new DefaultPekkoHttpServerComponents {
   override lazy val router = {
     case GET(p"/") => Action(parse.json) { body =>
       Ok("Hello")
     }
   }
 }
 val server = components.server

Attributes

Supertypes
class Object
trait Matchable
class Any
Show all
class PekkoHttpServer(context: Context) extends Server

Starts a Play server using Pekko HTTP.

Starts a Play server using Pekko HTTP.

Attributes

Companion
object
Supertypes
trait Server
class Object
trait Matchable
class Any

Creates an PekkoHttpServer from a given router using BuiltInComponents:

Creates an PekkoHttpServer from a given router using BuiltInComponents:

 val server = PekkoHttpServer.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.

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type

Components for building a simple Pekko HTTP Server.

Components for building a simple Pekko HTTP Server.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes

Knows how to create an PekkoHttpServer.

Knows how to create an PekkoHttpServer.

Attributes

Supertypes
class Object
trait Matchable
class Any