private static ServeFileHandler fileHandler = new ServeFileHandler();
private static ServeApiHandler apiHandler = new ServeApiHandler();
public WebAdmin(final Verticle verticle) {
final Vertx vertx = verticle.getVertx();
HttpServer server = vertx.createHttpServer();
server.requestHandler(new Handler<HttpServerRequest>() {
@Override
public void handle(HttpServerRequest request) {
Path path = Paths.get(request.uri);
if (path.startsWith("/api")) {
apiHandler.handle(request);
return;
}
fileHandler.handle(request);
}
});
SockJSServer sockjsServer = vertx.createSockJSServer(server);
JsonObject config = new JsonObject().putString("prefix", "/eventbus");
JsonArray inbound = new JsonArray();
inbound.addObject(new JsonObject().putString("address_re",
"deployment-manager\\.server\\..+"));