diff --git a/src/main/kotlin/net/halfbinary/tmnt/config/WebConfig.kt b/src/main/kotlin/net/halfbinary/tmnt/config/WebConfig.kt index 8c6a3cd..3e7ed8d 100644 --- a/src/main/kotlin/net/halfbinary/tmnt/config/WebConfig.kt +++ b/src/main/kotlin/net/halfbinary/tmnt/config/WebConfig.kt @@ -1,14 +1,20 @@ package net.halfbinary.tmnt.config +import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration import org.springframework.web.servlet.config.annotation.CorsRegistry -import org.springframework.web.servlet.config.annotation.EnableWebMvc import org.springframework.web.servlet.config.annotation.WebMvcConfigurer -@Configuration -@EnableWebMvc -class WebConfig : WebMvcConfigurer { - override fun addCorsMappings(registry: CorsRegistry) { - registry.addMapping("/**") +@Configuration(proxyBeanMethods = false) +class MyCorsConfiguration { + + @Bean + fun corsConfigurer(): WebMvcConfigurer { + return object : WebMvcConfigurer { + override fun addCorsMappings(registry: CorsRegistry) { + registry.addMapping("/**") + } + } } + } \ No newline at end of file