Skip to content

Commit

Permalink
chore: CorsConfig 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
nar0ng committed Aug 14, 2024
1 parent 5b7161d commit 24e85b6
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/main/java/cotato/growingpain/config/CorsConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package cotato.growingpain.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 CorsConfig implements WebMvcConfigurer {
@Override
public void addCorsMappings(CorsRegistry corsRegistry) {
corsRegistry.addMapping("/**")
.exposedHeaders("Set-Cookie")
.allowedOrigins("*")
.allowedMethods("GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS");
}
}

0 comments on commit 24e85b6

Please sign in to comment.