Skip to content

Instantly share code, notes, and snippets.

@andreybleme
andreybleme / crazy-client-production.properties
Created August 16, 2019 02:19
andreybleme.com | Centralized configuration with Spring Cloud Config
url=postgres://andreybleme-prod:password123prod@andreybleme.com:5432/my-prod-database
url.encrypted={cipher}3cad1441589b2bfb37c0e6127499222779a3e07ce073914033dece432f7331ea2f6bb2b955dadff60ec62100501
@andreybleme
andreybleme / bootstrap.properties
Created August 16, 2019 02:18
andreybleme.com | Centralized configuration with Spring Cloud Config
encrypt.key=my-crazy-key
@andreybleme
andreybleme / bootstrap.properties
Last active August 16, 2019 02:16
andreybleme.com | Centralized configuration with Spring Cloud Config
spring.application.name=crazy-client
spring.profiles.active=production
spring.cloud.config.uri=http://localhost:8888
@andreybleme
andreybleme / crazy-client-production.properties
Created August 16, 2019 02:14
andreybleme.com | Centralized configuration with Spring Cloud Config
url=postgres://andreybleme-prod:password123prod@andreybleme.com:5432/my-prod-database
@andreybleme
andreybleme / crazy-client-development.properties
Created August 16, 2019 02:13
andreybleme.com | Centralized configuration with Spring Cloud Config
url=postgres://andreybleme-dev:password123dev@andreybleme.com:5432/my-dev-database
@andreybleme
andreybleme / DatabaseController.java
Created August 16, 2019 02:09
andreybleme.com | Centralized configuration with Spring Cloud Config
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RefreshScope
@RestController
class DatabaseController {
@Value("${url}")
@andreybleme
andreybleme / bootstrap.properties
Created August 16, 2019 02:07
andreybleme.com | Centralized configuration with Spring Cloud Config
spring.application.name=crazy-client
spring.cloud.config.uri=http://localhost:8888
@andreybleme
andreybleme / crazy-client.properties
Created August 16, 2019 02:06
andreybleme.com | Centralized configuration with Spring Cloud Config
url=postgres://andreybleme:password123@andreybleme.com:5432/mydatabase
@andreybleme
andreybleme / application.properties
Created August 16, 2019 02:01
andreybleme.com | Centralized configuration with Spring Cloud Config
server.port=8888
spring.cloud.config.server.git.uri=https://github.com/andreybleme/discovering-spring-cloud-configserver
@andreybleme
andreybleme / DiscoveringConfigServerApplication.java
Created August 16, 2019 01:55
andreybleme.com | Centralized configuration with Spring Cloud Config
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.config.server.EnableConfigServer;
@EnableConfigServer
@SpringBootApplication
public class DiscoveringConfigServerApplication {
public static void main(String[] args) {
SpringApplication.run(DiscoveringConfigServerApplication.class, args);