ApplicationPath annotation isn't getting picked up #3140
Answered
by
jamezp
girdharshubham
asked this question in
Q&A
-
Hi. Main.java public class Main extends AbstractVerticle {
private static VertxResteasyDeployment deployment;
public static void main(String[] args) {
Vertx vertx = Vertx.vertx();
deployment = new VertxResteasyDeployment();
deployment.setApplicationClass("starter.rx.endpoint.V1");
deployment.start();
vertx.deployVerticle("starter.rx.Main");
}
@Override
public Completable rxStart() {
VertxRequestHandler handler = new VertxRequestHandler(vertx.getDelegate(), deployment);
return vertx.createHttpServer()
.requestHandler(x -> handler.handle(x.getDelegate()))
.rxListen(80)
.ignoreElement();
}
} V1.java @ApplicationPath("v1")
public class V1 extends Application {
private final Set<Object> singletons = new HashSet<>();
public V1() {
singletons.add(new Management());
}
@Override
public Set<Object> getSingletons() {
return singletons;
}
} Management.java @Path("")
public class Management {
@GET
@Path("health")
public CompletionStage<String> health() {
return Flowable.just("healthy").singleStage("");
}
} Logs
Output $ curl http://localhost:80/health
healthy
$ curl -i http://localhost:80/v1/health
HTTP/1.1 404 Not Found
transfer-encoding: chunked |
Beta Was this translation helpful? Give feedback.
Answered by
jamezp
Jul 7, 2022
Replies: 1 comment 5 replies
-
What version of RESTEasy are you using? |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
girdharshubham
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of RESTEasy are you using?