Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- NamedParameterNotBound
- 자바
- pscp
- 전치행렬 #C
- 디자인패턴
- java
- mycp
- 백준
- 10844
- junit
- 쉬운 계단 수
- Spring
- @Spring
- createQuery
- setParameter
- gradle
- @ModelAttribute
- decorator
- springboot
- 점세개
- BubbleSorting
- 여러인수
- @NotEmpty
- 10951
- 자료구조
- 데코레이터패턴
- Linux
- designpattern
- C
- 숫자야구
Archives
- Today
- Total
...
Spring CORS 에러 해결 본문
맨날 앱이랑만 작업해서 CORS 첨 봄,,,, 웹이랑 개발할 때 진짜 자주 보는 에러인가보다
ServerApplication 파일에 다음과 같은 환경설정을 해주니 해결되었다.
//Cors 에러 해결
@Bean
public WebMvcConfigurer corsConfigurer(){
return new WebMvcConfigurer() {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**").allowedOrigins("http://localhost:3000");
}
};
}
'백엔드' 카테고리의 다른 글
Spring Boot에서 gcp storage 사용 시 storage에 의존성 주입이 되지 않은 경우 (0) | 2023.07.26 |
---|---|
Spring 3.x에 Swagger 적용하기 (0) | 2023.07.25 |
Ec2 서버 배포 방법 정리 (0) | 2022.07.12 |
ec2 인바운드/아웃바운드 규칙 정리 (0) | 2022.07.06 |
HTTP 메소드 정리... (0) | 2022.06.09 |
Comments