From 747f03a3cdc1eacf3f8dd4b0dec6bdc0bf5ea5c4 Mon Sep 17 00:00:00 2001 From: kor-Chipmunk Date: Tue, 13 Feb 2024 18:31:04 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20CORS=20=ED=97=88=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/lalala/chart/config/WebConfiguration.kt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/backend/chart-server/chart-api/src/main/kotlin/com/lalala/chart/config/WebConfiguration.kt diff --git a/src/backend/chart-server/chart-api/src/main/kotlin/com/lalala/chart/config/WebConfiguration.kt b/src/backend/chart-server/chart-api/src/main/kotlin/com/lalala/chart/config/WebConfiguration.kt new file mode 100644 index 00000000..4d479112 --- /dev/null +++ b/src/backend/chart-server/chart-api/src/main/kotlin/com/lalala/chart/config/WebConfiguration.kt @@ -0,0 +1,17 @@ +package com.lalala.chart.config + +import org.springframework.context.annotation.Configuration +import org.springframework.web.reactive.config.CorsRegistry +import org.springframework.web.reactive.config.WebFluxConfigurer + +@Configuration +class WebConfig : WebFluxConfigurer { + override fun addCorsMappings(registry: CorsRegistry) { + registry.addMapping("/**") + .allowedOrigins("*") + .allowedMethods("*") + .allowedHeaders("*") + .allowCredentials(false) + .maxAge(60000) + } +} From 182e65277d36cb42c0cb60fc773d78d0f58f09a6 Mon Sep 17 00:00:00 2001 From: kor-Chipmunk Date: Tue, 13 Feb 2024 18:33:35 +0900 Subject: [PATCH 2/2] style: spotlessApply --- .../src/main/kotlin/com/lalala/chart/config/WebConfiguration.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/chart-server/chart-api/src/main/kotlin/com/lalala/chart/config/WebConfiguration.kt b/src/backend/chart-server/chart-api/src/main/kotlin/com/lalala/chart/config/WebConfiguration.kt index 4d479112..ecf790d4 100644 --- a/src/backend/chart-server/chart-api/src/main/kotlin/com/lalala/chart/config/WebConfiguration.kt +++ b/src/backend/chart-server/chart-api/src/main/kotlin/com/lalala/chart/config/WebConfiguration.kt @@ -5,7 +5,7 @@ import org.springframework.web.reactive.config.CorsRegistry import org.springframework.web.reactive.config.WebFluxConfigurer @Configuration -class WebConfig : WebFluxConfigurer { +class WebConfiguration : WebFluxConfigurer { override fun addCorsMappings(registry: CorsRegistry) { registry.addMapping("/**") .allowedOrigins("*")