package hello;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@SpringBootApplication
@ConfigurationProperties(locations="classpath:application.yml")
public class Application {

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

    @Bean
    public WebMvcConfigurer corsConfigurer() {
        return new WebMvcConfigurerAdapter() {
            @Override
            public void addCorsMappings(CorsRegistry registry) {
                registry.addMapping("/greeting-javaconfig").allowedOrigins("http://localhost:9000");
            }
        };
    }

}

@@ -106,32 +106,34 @@
 nfigure.
-SpringBootApplic
+EnableAutoConfigur
 ation;%0Ai
@@ -162,21 +162,16 @@
 ork.
-boot.
 context.
 prop
@@ -170,42 +170,23 @@
 ext.
-properties.ConfigurationProperties
+annotation.Bean
 ;%0Aim
@@ -221,34 +221,43 @@
 text.annotation.
-Be
+ComponentSc
 an;%0Aimport org.s
@@ -478,93 +478,46 @@
 ;%0A%0A@
-SpringBootApplication%0A@ConfigurationProperties(locations=%22classpath:application.yml%22)
+EnableAutoConfiguration%0A@ComponentScan
 %0Apub

test conf