All my code is here https://github.com/spencergibb/communityanswers/tree/so27131143
Src / main / java / application.java
@Configuration @EnableAutoConfiguration @EnableConfigServer public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } }
Src / core / resources / application.yml
spring: application: name: myconfigserver profiles: active: native my: property: myvalue
Src / main / resources / myapp.yml
my: otherprop: myotherval
To get properties for an application named myapp , follow these steps:
curl http://localhost:8080/myapp/default
{ "name": "default", "label": "master", "propertySources": [ { "name": "applicationConfig: [classpath:/myapp.yml]", "source": { "my.otherprop": "myotherval" } }, { "name": "applicationConfig: [classpath:/application.yml]", "source": { "spring.application.name": "myconfigserver", "spring.profiles.active": "native", "my.property": "myvalue" } } ] }
source share