diff --git a/docker/docker-compose.dev.yml b/docker/docker-compose.dev.yml index cafce7c..6aa5184 100644 --- a/docker/docker-compose.dev.yml +++ b/docker/docker-compose.dev.yml @@ -6,7 +6,7 @@ services: volumes: - mysql-data:/var/lib/mysql healthcheck: - test: [ 'CMD-SHELL', 'mysqladmin ping -h 127.0.0.1 -u root --password=$${MYSQL_ROOT_PASSWORD}' ] + test: [ 'CMD-SHELL', 'mysqladmin ping -h 127.0.0.1 -u root' ] interval: 10s timeout: 2s retries: 100 diff --git a/src/main/java/com/efub/dhs/global/config/CorsConfig.java b/src/main/java/com/efub/dhs/global/config/CorsConfig.java new file mode 100644 index 0000000..d3b472d --- /dev/null +++ b/src/main/java/com/efub/dhs/global/config/CorsConfig.java @@ -0,0 +1,20 @@ +package com.efub.dhs.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 CorsConfig implements WebMvcConfigurer { + + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/**") + .allowedOrigins("http://api.daehaengsa.kro.kr", + "https://api.daehaengsa.kro.kr", + "http://localhost:3000", + "https://daehaengsa.kro.kr") + .allowedMethods("GET", "POST") + .maxAge(3000); + } +}