Skip to content

Commit

Permalink
Merge pull request #24 from ktb1-eight/fixed/cicd-1
Browse files Browse the repository at this point in the history
Update WebConfig.java
  • Loading branch information
KimGyeongLock authored Sep 11, 2024
2 parents c6c7296 + b04d9f7 commit cd3c01a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/backend-ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ jobs:
-e DB_USERNAME=$(aws ssm get-parameter --name "/bami/DB_USERNAME" --query "Parameter.Value" --output text) \
-e DB_PASSWORD=$(aws ssm get-parameter --name "/bami/DB_PASSWORD" --with-decryption --query "Parameter.Value" --output text) \
-e EC2_PUBLIC_DNS=$(aws ssm get-parameter --name "/bami/PUBLIC_DNS_ADDR" --query "Parameter.Value" --output text) \
-e CLOUDFRONT_BASE_URL=$(aws ssm get-parameter --name "/bami/CLOUDFRONT_BASE_URL" --query "Parameter.Value" --output text) \
bami-backend:latest
echo "Deployment completed successfully."
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/example/bami/config/WebConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
@Configuration
public class WebConfig implements WebMvcConfigurer {

@Value("${app.end-point}")
private String endPoint;
@Value("${cors.allowed-origins}")
private String allowedOrigin;

@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**") // 모든 API 경로에 대해 CORS 설정
.allowedOrigins("http://" + endPoint + ":8080", "http://" + endPoint + ":3000")
.allowedOrigins(allowedOrigin)
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
.allowedHeaders("*")
.allowCredentials(true)
Expand Down

0 comments on commit cd3c01a

Please sign in to comment.