Created
January 6, 2021 09:46
-
-
Save jponge/0eb0904f1ceb2e339f219ee7423dce2b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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