use of io.vertx.reactivex.core.http.HttpServer in project api-framework by vinscom.
the class Server method start.
@StartService
public void start() {
HttpServer server = getVertx().createHttpServer(new HttpServerOptions().setPort(getPort()).setHost(getHost()));
Router router = Router.router(getVertx());
// Logging
if (getLog().isDebugEnabled()) {
router.route("/*").handler(LoggerHandler.create());
}
if (getSockJSHandler() != null) {
router.route("/eventbus/*").handler(getSockJSHandler());
}
for (int i = 0; i < mMountPath.length; i++) {
router.mountSubRouter(mMountPath[i], mRouter[i]);
}
server.requestHandler(router::accept).rxListen().blockingGet();
getLog().debug(() -> String.format("---------------Server[%s:%s] is ready-----------------", getHost(), getPort()));
}
Aggregations