Skip to content

Commit

Permalink
feat: cors 설정, 설정 시간 30분
Browse files Browse the repository at this point in the history
  • Loading branch information
juno-junho committed Oct 24, 2023
1 parent 4257b22 commit 19d3769
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 19d3769

Please sign in to comment.