Add simple configserver

This commit is contained in:
Dave Syer
2015-12-17 21:21:08 +00:00
parent 38424b9814
commit 6c8507d73e
8 changed files with 175 additions and 4 deletions

View File

@@ -7,21 +7,27 @@ import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.config.client.ConfigClientProperties;
import org.springframework.core.env.Environment;
/**
* @author Dave Syer
*/
@SpringBootApplication
public class BootstrapDecryptionClientApplication implements CommandLineRunner {
private static Log logger = LogFactory.getLog(BootstrapDecryptionClientApplication.class);
@Autowired
private ConfigClientProperties config;
@Autowired
private Environment environment;
@Override
public void run(String... args) throws Exception {
logger.info("Config Server URI: " + config.getUri());
logger.info("Config Server URI: " + this.config.getUri());
logger.info("And info.bar: " + this.environment.getProperty("info.bar"));
logger.info("And info.spam: " + this.environment.getProperty("info.spam"));
}
public static void main(String[] args) {

View File

@@ -1,3 +1,5 @@
spring:
application:
name: client
info:
bar: '{cipher}db63f1b828044c38f9fab4cbe4cd2ad508380399e184691902b3c44a38e5189f'