feat: cors 설정

This commit is contained in:
박정민 2024-07-24 10:17:21 +09:00
parent 4104eb89a8
commit 7e32f9ac39
2 changed files with 13 additions and 1 deletions

View File

@ -37,5 +37,10 @@ public class WebConfiguration implements WebMvcConfigurer {
registry.addResourceHandler("/img/**").addResourceLocations("classpath:/static/assets/img/");
registry.addResourceHandler("/*.html**").addResourceLocations("classpath:/static/");
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(jwtInterceptor)
.addPathPatterns("/**") // 모든 경로에 대해 인터셉터 적용
.excludePathPatterns("/auth/**", "/board/**", "/user/**","/lecture/**","/qna/**"); // 인증 없이 접근 가능한 경로 설정
}
}

View File

@ -30,6 +30,13 @@ public class Controller {
String roomName = params.get("roomName");
String participantName = params.get("participantName");
//
//
//
//
//
//
if (roomName == null || participantName == null) {
return ResponseEntity.badRequest().body(Map.of("errorMessage", "roomName and participantName are required"));
}