diff --git a/src/main/java/com/umc/naoman/global/config/SwaggerConfig.java b/src/main/java/com/umc/naoman/global/config/SwaggerConfig.java index dfac8c7..ec20131 100644 --- a/src/main/java/com/umc/naoman/global/config/SwaggerConfig.java +++ b/src/main/java/com/umc/naoman/global/config/SwaggerConfig.java @@ -22,7 +22,7 @@ public OpenAPI openAPI() { SecurityRequirement securityRequirement = new SecurityRequirement().addList("bearerAuth"); Server server = new Server(); - server.setUrl("https://www.naoman.site"); + server.setUrl("https://naoman.site"); Server local = new Server(); local.setUrl("http://localhost:8080"); diff --git a/src/main/java/com/umc/naoman/global/config/WebMvcConfig.java b/src/main/java/com/umc/naoman/global/config/WebMvcConfig.java new file mode 100644 index 0000000..4753279 --- /dev/null +++ b/src/main/java/com/umc/naoman/global/config/WebMvcConfig.java @@ -0,0 +1,18 @@ +package com.umc.naoman.global.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 WebMvcConfig implements WebMvcConfigurer { + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/**") + .allowedOriginPatterns("*") + .allowCredentials(true) + .allowedMethods("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS") + .allowedHeaders("*") + .maxAge(3600); + } +}