Skip to content

Commit

Permalink
Merge pull request #40 from nunsongCookie/main
Browse files Browse the repository at this point in the history
[Feat] WebConfig 추가
  • Loading branch information
Jixoo-IT authored Dec 31, 2024
2 parents bce6d00 + a022b2c commit a55c384
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/main/java/site/examready2025/quiz/config/WebConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package site.examready2025.quiz.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("/api/**") // API 경로에 대해 CORS 설정
.allowedOrigins("https://examready2025.site") // 프론트엔드 도메인
.allowedMethods("GET", "POST", "PUT", "DELETE") // 허용할 HTTP 메소드
.allowedHeaders("*") // 모든 헤더 허용
.allowCredentials(true);
}
}

0 comments on commit a55c384

Please sign in to comment.