[cors] spring boot 에서 cors

package com.kodegen.moneyplan.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( "/**" ).allowedOrigins( "*" );
	}
}

WebConfig 라는 클래스 만들고 . 위 내용 적고 빌드
( 모든 접속에 허용 )

Subscribe to X세대 신입사원

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
jamie@example.com
Subscribe
774-86-01972 cinnabar.3d@gmail.com