ASP.NET Core sample app illustrating how to use Spring Cloud Config Server as a configuration source.
$ git clone https://github.com/SteeltoeOSS/Samples $ cd samples/Configuration/src/Simple
The default configuration of Spring Cloud Config Server uses https://github.com/spring-cloud-samples/config-repo for its source of configuration data.
Start Spring Cloud Config Server using one of the following:
Building from source requires Java 8 JDK and Maven 3.x.
$ git clone https://github.com/spring-cloud/spring-cloud-config $ cd spring-cloud-config\spring-cloud-config-server $ git checkout v1.3.3.RELEASE $ mvn spring-boot:run
After building and running the app, you should see something like the following:
$ dotnet run -f netcoreapp3.1 Using launch settings from ... Hosting environment: development Content root path: .... Now listening on: http://localhost:5000 Application started. Press Ctrl+C to shut down.
Fire up a browser and open http://localhost:5000. Once on the home page, navigate to http://localhost:5000/Home/ConfigServer and you’ll see the values stored in the github repository used for the Spring Cloud Config Server samples.
If you navigate to the http://localhost:5000/Home/ConfigServerSettings, you will see the settings used by the Spring Cloud Config server client.
Change the Hosting environment setting to development
(i.e., set ASPNETCORE_ENVIRONMENT=development
), then restart the application. You will see different configuration data returned for that profile/hosting environment.
Note
|
See the App Configuration area of the Steeltoe site for a more in-depth walkthrough of the samples and more detailed information. |