Skip to content

Commit

Permalink
chore: WebConfig CORS 설정 (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyeong-hyeok committed Sep 13, 2023
1 parent 67aa359 commit e18b6f7
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/main/java/com/teamA/hicardi/config/WebConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.teamA.hicardi.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("/**")
.allowedOriginPatterns("*")
.allowedMethods("GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS")
.allowCredentials(true)
.allowedHeaders("*")
.maxAge(3000);
}
}

0 comments on commit e18b6f7

Please sign in to comment.