Skip to content

Commit

Permalink
Document how to change the base uri
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Warren committed Feb 4, 2019
1 parent b876ad5 commit b4063c3
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
34 changes: 34 additions & 0 deletions spring-content-rest/src/main/asciidoc/rest-baseuri.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
== Changing the Base URI
By default, Spring Content REST serves up REST resources at the root URI, '/'.

With Spring Boot 1.2 and later versions, you can change the base URI by setting a single property in application.properties, as follows:

====
[source, java]
----
spring.content.rest.baseUri=/api
----
====

Or if you are not using Spring Boot, you can do the following:

====
[source, java]
----
@Configuration
class CustomContentRestMvcConfiguration {
@Bean
public ContentRestConfigurer contentRestConfigurer() {
return new ContentRestConfigurer() {
@Override
public void configure(RestConfiguration config) {
config.setBaseUri(URI.create("/contentApi"));
}
};
}
}
----
====
2 changes: 2 additions & 0 deletions spring-content-rest/src/main/asciidoc/rest-index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ include::{spring-versions-jpa-docs}/jpaversions-rest.adoc[leveloffset=+1]
:leveloffset: -1

include::rest-cors.adoc[leveloffset=+1]

include::rest-baseuri.adoc[leveloffset=+1]
//[[appendix]]
//= Appendix

Expand Down

0 comments on commit b4063c3

Please sign in to comment.