Skip to content

Commit

Permalink
Merge pull request #34 from TEAM-DHS/deploy/cors
Browse files Browse the repository at this point in the history
[FEAT] CORS 설정 추가
  • Loading branch information
mingulmangul authored Nov 20, 2023
2 parents 9473e52 + a0f6579 commit a69e4a4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docker/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 20 additions & 0 deletions src/main/java/com/efub/dhs/global/config/CorsConfig.java
Original file line number Diff line number Diff line change
@@ -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);
}
}

0 comments on commit a69e4a4

Please sign in to comment.