22 lines
707 B
Kotlin
22 lines
707 B
Kotlin
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.WebMvcConfigurer
|
|
|
|
@Configuration(proxyBeanMethods = false)
|
|
class MyCorsConfiguration {
|
|
|
|
@Bean
|
|
fun corsConfigurer(): WebMvcConfigurer {
|
|
return object : WebMvcConfigurer {
|
|
override fun addCorsMappings(registry: CorsRegistry) {
|
|
registry.addMapping("/**")
|
|
.allowedOrigins("*")
|
|
.allowedMethods("GET")
|
|
}
|
|
}
|
|
}
|
|
|
|
} |