Skip to content

Commit

Permalink
feat: Cors 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
juno-junho committed Oct 23, 2023
1 parent a932642 commit 1b169fc
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/main/java/com/spaceclub/global/config/WebConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.spaceclub.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 WebConfig implements WebMvcConfigurer {

@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedMethods("*")
.allowCredentials(true)
.maxAge(1800); // 1800초, 30분으로 설정
}

}

0 comments on commit 1b169fc

Please sign in to comment.