Skip to content

Commit

Permalink
[Refactor] CORS설정
Browse files Browse the repository at this point in the history
  • Loading branch information
hen715 committed Jan 30, 2024
1 parent 1104432 commit 60ff3de
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package kr.inuappcenterportal.inuportal.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("/**")
.allowedOrigins("*")
.allowedMethods("GET","POST","PUT","DELETE")
.allowedHeaders("Auth","Content-Type")
.allowCredentials(true)
.maxAge(3600);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
@Slf4j
@RestController
@RequiredArgsConstructor
@CrossOrigin(origins = "*",allowCredentials = "*")
@RequestMapping("/api/members")
public class MemberController {
private final TokenProvider tokenProvider;
Expand Down

0 comments on commit 60ff3de

Please sign in to comment.