Skip to content

Commit

Permalink
feat: CORS 설정 추가
Browse files Browse the repository at this point in the history
- Swaager UI , api 테스트 가능하도록 하기 위해 CORS 설정 추가
  • Loading branch information
jimi567 committed Jul 17, 2024
1 parent 47e07ae commit d84463f
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.woowacourse.friendogly.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")
.allowedMethods("GET", "POST", "PUT", "PATCH", "DELETE")
.allowedHeaders("*")
.allowCredentials(true);
}
}

0 comments on commit d84463f

Please sign in to comment.