Skip to content

Commit

Permalink
Feat: CORS 설정 (#114)
Browse files Browse the repository at this point in the history
* #113 - feat: CORS 설정 (#114)

프론트엔드의 로컬, 배포 주소에 CORS 해제
  • Loading branch information
morenow98 authored Feb 13, 2024
1 parent e080554 commit fde4e99
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/main/java/cotato/bookitlist/config/WebConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package cotato.bookitlist.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {

@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("http://localhost:3000", "https://bookitlist.store")
.allowedHeaders("*")
.allowedMethods("*")
;
}
}

0 comments on commit fde4e99

Please sign in to comment.