Start the server:
$ CD Spring-cloud-config-server
$ .. /MVNW Spring-boot:run
The server is a spring boot application, so you can run it from the IDE instead of liking it (the main class is configserverapplication). Then try a client:
$ 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 resources is to clone a git repository (in Spring.cloud.config.server.git.uri) and use it to initialize a mini springapplication. The environment of the applet is used to enumerate the property sources and publish them through the JSON endpoint.
The HTTP service has resources in the following format:
/{application}/{profile}[/{label}]
/{application}-{profile}.yml
/{label}/{application}-{profile}.yml
/{application}-{profile}.properties
/{label}/{application}-{profile}.properties
Where "Application" is injected as Spring.config.name in Springapplication (that is, typically "application" in a regular spring boot application), "configuration file" is the active profile (or a comma-separated list of properties), " Label is an optional git tag (default is "Master").
The Spring Cloud Config server provides configuration for remote clients from a git repository (must be provided):
Spring
Cloud
Config
Server
Git:
Uri:https://github.com/spring-cloud-samples/config-repo
Spring Cloud config-Quick Start