Skip to content

Commit

Permalink
fix: CORS 허용
Browse files Browse the repository at this point in the history
  • Loading branch information
Haewonny committed Jan 11, 2024
1 parent 97d8643 commit 2e08ae2
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/main/java/tenten/blooming/global/config/WebMvcConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package tenten.blooming.global.config;

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

@Configuration
@EnableWebMvc
public class WebMvcConfig implements WebMvcConfigurer {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("http://localhost:3000")
.allowedMethods("OPTIONS","GET","POST","PUT","DELETE");
}
}

0 comments on commit 2e08ae2

Please sign in to comment.