public class Server
extends java.lang.Object
Constructor and Description |
---|
Server(play.core.server.Server server) |
Modifier and Type | Method and Description |
---|---|
static Server |
forRouter(play.api.routing.Router router)
Create a server for the given router.
|
static Server |
forRouter(play.api.routing.Router router,
int port)
Create a server for the given router.
|
static Server |
forRouter(play.api.routing.Router router,
Mode mode)
Create a server for the given router.
|
static Server |
forRouter(play.api.routing.Router router,
Mode mode,
int port)
Create a server for the given router.
|
int |
httpPort()
Get the port the server is running on.
|
java.net.InetSocketAddress |
mainAddress()
Get the address the server is running on.
|
void |
stop()
Stop the server.
|
public void stop()
public int httpPort()
public java.net.InetSocketAddress mainAddress()
public static Server forRouter(play.api.routing.Router router)
The server will be running on a randomly selected ephemeral port, which can be checked using the httpPort property.
The server will be running in TEST mode.
router
- The router for the server to serve.public static Server forRouter(play.api.routing.Router router, Mode mode)
The server will be running on a randomly selected ephemeral port, which can be checked using the httpPort property.
router
- The router for the server to serve.mode
- The mode the server will run on.public static Server forRouter(play.api.routing.Router router, int port)
The server will be running in TEST mode.
router
- The router for the server to serve.port
- The port the server will run on.