Skip to content

Commit

Permalink
feat : CORS 관련 이슈 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
thsghdud13 committed Sep 28, 2024
1 parent 8b0b797 commit d11a109
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/main/java/Be9room/festime/config/WebConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package Be9room.festime.config;

import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
@RequiredArgsConstructor
public class WebConfig implements WebMvcConfigurer {

@Override
public void addCorsMappings(CorsRegistry registry) {
registry
.addMapping("/**")
.allowedHeaders("*")
.allowedOrigins("http://localhost:5173", "https://inhafestime.com")
.allowedMethods("*");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import Be9room.festime.common.RandomNameGenerator;
import Be9room.festime.dto.MemberDto;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
Expand Down

0 comments on commit d11a109

Please sign in to comment.