Skip to content

Commit

Permalink
[fix] : WebConfig 주석 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
dudxo committed Sep 5, 2024
1 parent 3b0ad09 commit 85aff03
Showing 1 changed file with 17 additions and 22 deletions.
39 changes: 17 additions & 22 deletions src/main/java/com/dnd/gongmuin/security/config/WebConfig.java
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
package com.dnd.gongmuin.security.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 WebConfig implements WebMvcConfigurer {

// Spring MVC cors 설정
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("http://localhost:3000", "https://gongmuin.netlify.app/", "https://gongmuin.netlify.app",
"https://gongmuin.site", "http://localhost:8080")
.allowedMethods("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS")
.allowCredentials(true)
.allowedHeaders("*")
.exposedHeaders("Set-Cookie", "Authorization")
.maxAge(3000);
}
}
// @Configuration
// @EnableWebMvc
// public class WebConfig implements WebMvcConfigurer {
//
// // Spring MVC cors 설정
// @Override
// public void addCorsMappings(CorsRegistry registry) {
// registry.addMapping("/**")
// .allowedOrigins("http://localhost:3000", "https://gongmuin.netlify.app/", "https://gongmuin.netlify.app",
// "https://gongmuin.site", "http://localhost:8080")
// .allowedMethods("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS")
// .allowCredentials(true)
// .allowedHeaders("*")
// .exposedHeaders("Set-Cookie", "Authorization")
// .maxAge(3000);
// }
// }

0 comments on commit 85aff03

Please sign in to comment.