I\'m trying to to mix mvc and rest in a single spring boot project.
I want to set base path for all rest controllers (eg. example.com/api) in a single place (I don\'
Try using a PathMatchConfigurer (Spring Boot 2.x):
@Configuration public class WebMvcConfig implements WebMvcConfigurer { @Override public void configurePathMatch(PathMatchConfigurer configurer) { configurer.addPathPrefix("api", HandlerTypePredicate.forAnnotation(RestController.class)); } }