public interface Server
Modifier and Type | Method and Description |
---|---|
static Server |
create()
Creates an HTTP server with no request handlers.
|
io.vertx.ext.web.Router |
createRouter()
Creates a request router.
|
void |
mountSubRouter(java.lang.String mountPoint,
io.vertx.ext.web.Router subRouter)
Mounts the sub router on the root router of this server.
|
void |
start(int port)
Starts listening on the given TCP port.
|
java.util.concurrent.CompletableFuture<java.lang.Void> |
stop()
Requests the server to stop listening to incoming requests and release any resources.
|
static Server create()
Use start(int)
to start listening to incoming requests.
io.vertx.ext.web.Router createRouter()
void mountSubRouter(java.lang.String mountPoint, io.vertx.ext.web.Router subRouter)
Please note that the prefix is stripped from the path when request is forwarded to the sub-router. For example, to handle requests to '/cryptocurrency/send-money' and '/cryptocurrency/balance', use prefix '/cryptocurrency' and a router forwarding requests to '/send-money' and '/balance' to the appropriate handlers.
mountPoint
- a mount point (a path prefix) to mount it onsubRouter
- a router responsible for handling requests that have the given path prefixvoid start(int port)
port
- a port to listen onjava.util.concurrent.CompletableFuture<java.lang.Void> stop()
Subsequent invocations have no effect. Once stopped, the server cannot be restarted. Please create a new server.
Copyright © 2018 Exonum. All rights reserved.