HttpServer

wvlet.airframe.http.HttpServer
trait HttpServer extends AutoCloseable

A common trait for Http server implementations

Attributes

Graph
Supertypes
trait AutoCloseable
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def awaitTermination(): Unit

Await and block until the server is terminated. If the server is already terminated, it will return immediately.

Await and block until the server is terminated. If the server is already terminated, it will return immediately.

Attributes

def localAddress: String

Return the local server address in (host):(port) format. e.g., localhost:8080. This method can be used for creating a new Http client for the server. For example:

Return the local server address in (host):(port) format. e.g., localhost:8080. This method can be used for creating a new Http client for the server. For example:

 Netty.server.withRouter(router).start { server =>
   Using.resource(Http.client.newSyncClient(server.localAddress)) { client =>
      val resp = client.send(Http.GET("/hello"))
   }
 }

Attributes

def stop(): Unit

Stop the server

Stop the server

Attributes

Concrete methods

override def close(): Unit

Stop the server. When using Airframe DI, this method will be called automatically.

Stop the server. When using Airframe DI, this method will be called automatically.

Attributes

Definition Classes
AutoCloseable