Programmatically start HTTP server from command line application #43925
-
Hello, I am new to Quarkus and I am writing a command line application that has a command "serve" the starts up the HTTP server and waits for requests and shut down. The other commands allows to connect to the server and call its endpoints. Does anybody can provide some hints on how to do this? I would like to use the Picocli integration so that I have other nice CLI features enabled. Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Answered by
cescoffier
Oct 18, 2024
Replies: 1 comment 1 reply
-
You can create your own HTTP server using the Vert.x API directly. Here is an example:
@Inject Vertx vertx;
// ...
var server = vertx.createHttpServer();
server
.requestHandler(req -> req.response().end("Hello verticle 2"))
.listen(8080); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
libe
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can create your own HTTP server using the Vert.x API directly.
Here is an example: