Reputation: 75
In Spring Boot / Tomcat is it possible to override the context-path (server.servlet.context-path=/api
) specified in my application.properties
for a single @RequestMapping
?
My current context path is /api
for the core application, but I have a public-facing portion of the API that I'd like to expose as /id
and not /api/id
.
Upvotes: 1
Views: 733
Reputation: 732
With Spring Boot 2.x, all it takes is a single property in application.properties:
server.servlet.context-path=/api
With Spring Boot 1.2+ (<2.0)
spring.data.rest.basePath=/api
Upvotes: 0