Skip to content

Commit

Permalink
test : cors 테스트
Browse files Browse the repository at this point in the history
  • Loading branch information
YASICJUNWOO committed Sep 5, 2023
1 parent 3451ab2 commit bdc1e47
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/main/java/KJW/MBTIcoummunity/Config/WebConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package KJW.MBTIcoummunity.Config;

import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod;
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");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@SpringBootApplication
public class MbtIcoummunityApplication {
Expand Down

0 comments on commit bdc1e47

Please sign in to comment.