generated from pricelees/issue-pr-template
[#28] 쿠버네티스 환경 배포 #29
@ -1,14 +1,19 @@
|
|||||||
package roomescape.common.config
|
package roomescape.common.config
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Value
|
||||||
import org.springframework.context.annotation.Configuration
|
import org.springframework.context.annotation.Configuration
|
||||||
import org.springframework.web.servlet.config.annotation.CorsRegistry
|
import org.springframework.web.servlet.config.annotation.CorsRegistry
|
||||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
class CorsConfig : WebMvcConfigurer {
|
class CorsConfig : WebMvcConfigurer {
|
||||||
|
|
||||||
|
@Value("\${cors-origin}")
|
||||||
|
private lateinit var origin: String
|
||||||
|
|
||||||
override fun addCorsMappings(registry: CorsRegistry) {
|
override fun addCorsMappings(registry: CorsRegistry) {
|
||||||
registry.addMapping("/**")
|
registry.addMapping("/**")
|
||||||
.allowedOrigins("http://localhost:5173")
|
.allowedOrigins(origin)
|
||||||
.allowedMethods("GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS")
|
.allowedMethods("GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS")
|
||||||
.allowedHeaders("Authorization", "Content-Type")
|
.allowedHeaders("Authorization", "Content-Type")
|
||||||
.maxAge(3600) // 1 hour
|
.maxAge(3600) // 1 hour
|
||||||
|
|||||||
@ -37,3 +37,5 @@ management:
|
|||||||
tracing:
|
tracing:
|
||||||
transport: ${OTLP_TRACING_PROTOCOL}
|
transport: ${OTLP_TRACING_PROTOCOL}
|
||||||
endpoint: ${OTLP_TRACING_ENDPOINT}
|
endpoint: ${OTLP_TRACING_ENDPOINT}
|
||||||
|
|
||||||
|
cors-origin: ${CORS_ORIGIN}
|
||||||
@ -45,3 +45,5 @@ management:
|
|||||||
tracing:
|
tracing:
|
||||||
sampling:
|
sampling:
|
||||||
probability: 1
|
probability: 1
|
||||||
|
|
||||||
|
cors-origin: "http://localhost:5173"
|
||||||
Loading…
x
Reference in New Issue
Block a user