public static class Server.Builder
extends java.lang.Object
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
Server |
build(java.util.function.Function<BuiltInComponents,Router> block)
Build the server and begin serving the provided routes as configured.
|
Server |
build(Router router)
Build the server and begin serving the provided routes as configured.
|
Server.Builder |
http(int port)
Instruct the server to serve HTTP on a particular port.
|
Server.Builder |
https(int port)
Configure the server to serve HTTPS on a particular port.
|
Server.Builder |
mode(Mode mode)
Set the mode the server should be run on (defaults to TEST)
|
public Server.Builder http(int port)
port
- the port on which to serve http trafficpublic Server.Builder https(int port)
port
- the port on which to serve ssl trafficpublic Server.Builder mode(Mode mode)
mode
- the Play mode (dev, prod, test)public Server build(Router router)
router
- the router to use.public Server build(java.util.function.Function<BuiltInComponents,Router> block)
block
- the router to use.