6

I would like to set the base path under which all my RESTEasy resources would fall, without having to include a class that extends javax.ws.rs.core.Application.

Basically I would like to get rid of:

import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;

@ApplicationPath("/api")
public class MyApplication extends Application {

}

How can I achieve that?

geoand
  • 60,071
  • 24
  • 172
  • 190

3 Answers3

10

Quarkus allows the base path to be configured in application.properties (see here).

So simply replace the class above with the following in application.properties:

quarkus.resteasy.path=/api

UPDATE

When using RESTEasy Reactive, as pointed out by https://stackoverflow.com/a/72426133/2504224, one needs to use:

quarkus.resteasy-reactive.path=/api/
geoand
  • 60,071
  • 24
  • 172
  • 190
5

The accepted answer works for quarkus resteasy classic.

If you are using quarkus-resteasy-reactive you will need to set:

quarkus.resteasy-reactive.path=/api/
lorefnon
  • 12,875
  • 6
  • 61
  • 93
0

I am using Quarkus 2.13.1 and I made the following configuration. More info.

Modify application.properties file and add the following lines

# Apply this path for the whole application, including metrics, etc.
quarkus.http.root-path=/api/
# In case you want to change a different route
quarkus.http.non-application-root-path=/q
Juanes30
  • 2,398
  • 2
  • 24
  • 38