To change the base path in Spring Data Rest is relatively easy, you just add
spring.data.rest.basePath=/api if you have Spring Boot 1.2.3+ in application.properties and then your base
path to Spring Data Rest would be at localhost:8080/api.
But unfortunately for me it didn’t work. Thanks to raised issue on github I found out that the problem was in my custom config which I used to expose ids of the entities:
So if you extend the configuration it wipes settings which were set up in .properties file. The solution is to set base path in this config:
Another solution is to extend
RepositoryRestConfigurerAdapter instead of
RepositoryRestMvcConfiguration. In this case you’ll be able to use