PekkoHttpServer

play.core.server.PekkoHttpServer
See thePekkoHttpServer companion class

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
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

final case class Context(config: ServerConfig, appProvider: ApplicationProvider, actorSystem: ActorSystem, materializer: Materializer, stopHook: () => Future[_])

The values needed to initialize an PekkoHttpServer.

The values needed to initialize an PekkoHttpServer.

Value parameters

actorSystem

An ActorSystem that the server can use.

appProvider

An object which can be queried to get an Application.

config

Basic server configuration values.

stopHook

A function that should be called by the server when it stops. This function can be used to close resources that are provided to the server.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Context

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Context.type

Value members

Concrete methods

Create a Pekko HTTP server from the given application and server configuration.

Create a Pekko HTTP server from the given application and server configuration.

Value parameters

application

The application.

config

The server configuration.

Attributes

Returns

A started Pekko HTTP server, serving the application.

Inherited methods

Creates a Server from the given router, using ServerComponents.

Creates a Server from the given router, using ServerComponents.

Value parameters

config

the server configuration

routes

the routes definitions

Attributes

Returns

an PekkoHttpServer instance

Inherited from:
ServerFromRouter (hidden)

Deprecated and Inherited methods

Creates a Server from the given router.

Creates a Server from the given router.

Value parameters

config

the server configuration

routes

the routes definitions

Attributes

Returns

an PekkoHttpServer instance

Deprecated
true
Inherited from:
ServerFromRouter (hidden)

Implicits

Implicits

A ServerProvider for creating an PekkoHttpServer.

A ServerProvider for creating an PekkoHttpServer.

Attributes