Skip to content

Instantly share code, notes, and snippets.

@jponge
Created January 6, 2021 09:46
Show Gist options
  • Save jponge/0eb0904f1ceb2e339f219ee7423dce2b to your computer and use it in GitHub Desktop.
Save jponge/0eb0904f1ceb2e339f219ee7423dce2b to your computer and use it in GitHub Desktop.
//usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS io.vertx:vertx-core:4.0.0
import io.vertx.core.Vertx;
public class RunVertx {
public static void main(String... args) {
var vertx = Vertx.vertx();
vertx.createHttpServer()
.requestHandler(req -> req.response().end("Vert.x in Action is the best book ever. Obviously."))
.listen(8080)
.onComplete(server -> System.out.println("Go to http://127.0.0.1:8080/"))
.onFailure(Throwable::printStackTrace);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment