participation-service CORS 설정 수정
- SecurityConfig.java @Value 어노테이션 문법 오류 수정 - application.yml CORS allowed-origins에 localhost:3000 추가 - Frontend UI (localhost:3000)에서 API 호출 시 CORS 에러 해결
This commit is contained in:
parent
5cac8ccc12
commit
7ed2465d57
@ -24,7 +24,7 @@ import java.util.Arrays;
|
|||||||
@EnableWebSecurity
|
@EnableWebSecurity
|
||||||
public class SecurityConfig {
|
public class SecurityConfig {
|
||||||
|
|
||||||
@Value("${cors.allowed-origins:*")
|
@Value("${cors.allowed-origins:*}")
|
||||||
private String allowedOrigins;
|
private String allowedOrigins;
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
|||||||
@ -56,7 +56,7 @@ jwt:
|
|||||||
|
|
||||||
# CORS 설정
|
# CORS 설정
|
||||||
cors:
|
cors:
|
||||||
allowed-origins: ${CORS_ALLOWED_ORIGINS:http://localhost:8081,http://localhost:8082,http://localhost:8083,http://localhost:8084,http://kt-event-marketing.20.214.196.128.nip.io}
|
allowed-origins: ${CORS_ALLOWED_ORIGINS:http://localhost:3000,http://localhost:8081,http://localhost:8082,http://localhost:8083,http://localhost:8084,http://kt-event-marketing.20.214.196.128.nip.io}
|
||||||
allowed-methods: ${CORS_ALLOWED_METHODS:GET,POST,PUT,DELETE,OPTIONS,PATCH}
|
allowed-methods: ${CORS_ALLOWED_METHODS:GET,POST,PUT,DELETE,OPTIONS,PATCH}
|
||||||
allowed-headers: ${CORS_ALLOWED_HEADERS:*}
|
allowed-headers: ${CORS_ALLOWED_HEADERS:*}
|
||||||
allow-credentials: ${CORS_ALLOW_CREDENTIALS:true}
|
allow-credentials: ${CORS_ALLOW_CREDENTIALS:true}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user