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...