Skip to content

Commit 34f6b38

Browse files
authored
Merge pull request #146 from prgrms-web-devcourse-final-project/chore/33-infra
Chore/33 infra
2 parents 1ad6b27 + be80ab9 commit 34f6b38

File tree

5 files changed

+9
-13
lines changed

5 files changed

+9
-13
lines changed

backend/src/main/java/com/ai/lawyer/global/security/SecurityConfig.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,13 @@ public PasswordEncoder passwordEncoder() {
6464
@Bean
6565
public CorsConfigurationSource corsConfigurationSource() {
6666
CorsConfiguration configuration = new CorsConfiguration();
67-
configuration.setAllowedOrigins(List.of("http://localhost:3000, https://www.trybalaw.com, https://api.trybalaw.com"));
67+
configuration.setAllowedOrigins(List.of(
68+
"http://localhost:3000",
69+
"https://www.trybalaw.com",
70+
"https://api.trybalaw.com",
71+
"https://balaw.vercel.app"));
6872
configuration.setAllowedMethods(List.of("GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"));
69-
configuration.setAllowedHeaders(List.of("*"));
73+
configuration.setAllowedHeaders(List.of("Authorization","Content-Type","Accept","X-Requested-With"));
7074
configuration.setAllowCredentials(true);
7175

7276
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();

backend/src/main/java/com/ai/lawyer/global/springDoc/SpringDocConfig.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import io.swagger.v3.oas.models.servers.Server;
1111
import org.springdoc.core.customizers.OpenApiCustomizer;
1212
import org.springdoc.core.models.GroupedOpenApi;
13-
import org.springframework.beans.factory.annotation.Value;
1413
import org.springframework.context.annotation.Bean;
1514
import org.springframework.context.annotation.Configuration;
1615

@@ -31,9 +30,6 @@
3130
)
3231
public class SpringDocConfig {
3332

34-
@Value("${server.url:http://localhost:8080}")
35-
private String serverUrl;
36-
3733
@Bean
3834
public GroupedOpenApi memberApi() {
3935
return GroupedOpenApi.builder()
@@ -112,7 +108,7 @@ private OpenApiCustomizer orderBySummaryNumber() {
112108
public OpenAPI customOpenAPI() {
113109
return new OpenAPI()
114110
.servers(List.of(
115-
new Server().url(serverUrl).description("Current Environment Server")
111+
new Server().url("/api").description("Relative (proxy-friendly)")
116112
));
117113
}
118114
}

backend/src/main/resources/application-dev.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
server:
2-
url: ${DEV_URL}
3-
41
spring:
52
datasource:
63
url: ${DEV_DATASOURCE_URL}

backend/src/main/resources/application-prod.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
server:
2-
url: ${prod-url}
3-
41
spring:
52
autoconfigure:
63
exclude:

backend/src/main/resources/application.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
server:
2+
forward-headers-strategy: framework
13
spring:
24
autoconfigure:
35
exclude:

0 commit comments

Comments
 (0)