If you have worked with Spring Data Rest, you would have observed that by default, Spring serves the requests to the root URI '/'.
If you want to append a specific string to the base path, you can specify the following property in application.properties file inside the resources folder
spring.data.rest.basePath=/api
This solution is provided in Spring Boot 1.2 and later versions.
In my case it did not work for me, after searching for it over the internet, I have found the solution, instead of basePath property, set the following property in application.properties file
server.servlet.context-path=/api
Please leave your comments.
If you want to append a specific string to the base path, you can specify the following property in application.properties file inside the resources folder
spring.data.rest.basePath=/api
This solution is provided in Spring Boot 1.2 and later versions.
In my case it did not work for me, after searching for it over the internet, I have found the solution, instead of basePath property, set the following property in application.properties file
server.servlet.context-path=/api
Please leave your comments.
Comments
Post a Comment