Update docs and add uri parameter
This commit is contained in:
26
README.md
26
README.md
@@ -18,6 +18,32 @@ $ cd spring-platform-config-server
|
||||
$ mvn spring-boot:run
|
||||
```
|
||||
|
||||
Then try it:
|
||||
|
||||
```
|
||||
$ curl localhost:8888/foo/development
|
||||
{"name":"development","label":"master","propertySources":[
|
||||
{"name":"https://github.com/scratches/config-repo/foo-development.properties","source":{"bar":"spam"}},
|
||||
{"name":"https://github.com/scratches/config-repo/foo.properties","source":{"foo":"bar"}}
|
||||
]}
|
||||
```
|
||||
|
||||
The default strategy for locating property sources is to clone a GIT
|
||||
repository (at "spring.platform.config.uri") and use it to initialize
|
||||
a `SpringApplication`. The application's `Environment` is used to
|
||||
enumerate property sources. The service has resources in the form:
|
||||
|
||||
```
|
||||
/{name}/{profile}[/{label}]
|
||||
```
|
||||
|
||||
where the "name" is used as the config name in the `SpringApplication`
|
||||
(i.e. what is normally "application"), "profile" is an active profile
|
||||
(or comma-separated list of properties), and "label" is an optional
|
||||
git label (defaults to "master").
|
||||
|
||||
### Client Side Usage
|
||||
|
||||
Build a client (e.g. see the test cases for the config-client) as a
|
||||
Spring Boot application that depends on spring-platform-config-client.
|
||||
When it runs it will pick up the external configuration from the
|
||||
|
||||
@@ -4,6 +4,7 @@ package org.springframework.platform.config.server;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -53,6 +54,7 @@ public class Application {
|
||||
@Profile("!native")
|
||||
protected static class GitRepositoryConfiguration {
|
||||
@Bean
|
||||
@ConfigurationProperties("spring.platform.config")
|
||||
public JGitEnvironmentRepository repository() {
|
||||
return new JGitEnvironmentRepository();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user