Implementing Cloud Config Server

Let's implement an application main class that has more special annotations. Here, @SpringBootApplication will pull all the default and required configurations, and another annotation, @EnableConfigServer, will turn our application into a configuration server:

package com.dineshonjava.cloudconfigapp; 
 
import org.springframework.boot.SpringApplication; 
import org.springframework.boot.autoconfigure.SpringBootApplication; 
import org.springframework.cloud.config.server.EnableConfigServer; 
 
@SpringBootApplication 
@EnableConfigServer 
public class CloudConfigApplication { 
   public static void main(String[] args) { 
         SpringApplication.run(CloudConfigApplication.class, args); 
   } 
} 

As you can, this enables the application as a configuration server. But by default, the server port will be 8080. We can change this default port configuration, and we have to provide the Git URI, which provides our version-controlled configuration content. Let's look at the following application.properties file.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset