package io.vertx.vertx_mlv; import io.vertx.core.AbstractVerticle; import io.vertx.core.Future; import io.vertx.ext.web.Router; public class HelloWorld extends AbstractVerticle { @Override public void start(final Future startFuture) throws Exception { final Router router = Router.router(vertx); router.get("/hello/") .handler(req -> req.response() .putHeader("content-type", "text/html") .end("

Hello World

")); vertx.createHttpServer() .requestHandler(router::accept) .listen(8081, res -> { if (res.succeeded()) { startFuture.complete(); } else { startFuture.fail(res.cause()); } }); } public static void main(String[] args) throws Exception { new HelloWorld().start(); } }