Skip to content

Commit

Permalink
[FEAT] WebMvcConfig 작성
Browse files Browse the repository at this point in the history
  • Loading branch information
ghdeo committed Oct 19, 2023
1 parent 421baf6 commit 169c8b2
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/main/java/com/bull4jo/kkanbustock/config/WebMvcConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.bull4jo.kkanbustock.config;


import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.CorsConfigurationSource;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CommonsRequestLoggingFilter;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.servlet.Filter;

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("http://localhost:3000")
.allowedMethods("*") // 기타 설정
.allowedHeaders("*");
}
}

0 comments on commit 169c8b2

Please sign in to comment.