Skip to content

Commit

Permalink
feat : 모든 요청 다 받도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
jsilver01 committed Aug 6, 2024
1 parent 2b1e978 commit 3fae92a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/main/java/com/example/likelion12/config/WebConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.example.likelion12.config;

import org.springframework.context.annotation.Bean;
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", "PATCH", "OPTIONS")
.allowedHeaders("*")
.allowCredentials(false)
.maxAge(3600);
}
}

0 comments on commit 3fae92a

Please sign in to comment.