From eee916dafc0d1cd9d8d7bfc23944d527ca025940 Mon Sep 17 00:00:00 2001 From: jcw1031 Date: Fri, 26 Apr 2024 17:28:49 +0900 Subject: [PATCH] hotfix: configure cors --- .../ac/knu/likeknu/config/WebConfiguration.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/main/java/ac/knu/likeknu/config/WebConfiguration.java diff --git a/src/main/java/ac/knu/likeknu/config/WebConfiguration.java b/src/main/java/ac/knu/likeknu/config/WebConfiguration.java new file mode 100644 index 0000000..dc79736 --- /dev/null +++ b/src/main/java/ac/knu/likeknu/config/WebConfiguration.java @@ -0,0 +1,16 @@ +package ac.knu.likeknu.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 WebConfiguration implements WebMvcConfigurer { + + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/**") + .allowedOrigins("*") + .allowedMethods("*"); + } +}