Skip to content

Commit

Permalink
Merge pull request #37 from Leets-Official/30-fearture-domain
Browse files Browse the repository at this point in the history
feat: 도메인 연결
  • Loading branch information
yechan-kim authored Jul 31, 2024
2 parents 9b9fcb0 + c090a91 commit 6bf63ad
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.leets.commitatobe.global.filter.JwtAuthenticationFilter;
import com.leets.commitatobe.global.utils.JwtProvider;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
Expand All @@ -24,8 +23,6 @@
@EnableWebSecurity
@RequiredArgsConstructor
public class SecurityConfig {
@Value("${domain.uri}")
private String DOMAIN_URI;
private final JwtProvider jwtProvider;

@Bean
Expand Down Expand Up @@ -63,9 +60,12 @@ CorsConfigurationSource corsConfigurationSource() {
"http://localhost:8080",
"http://localhost:3000",
"http://localhost:5173",
"http://localhost:5174",
"https://api.commitato.com",
"https://commitato.com",
"https://www.commitato.com",
"https://api.github.com",
"https://github.com",
DOMAIN_URI));
"https://github.com"));
configuration.setAllowedMethods(Arrays.asList("HEAD", "GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"));
configuration.setAllowCredentials(true);
configuration.setAllowedHeaders(List.of("*"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ public OpenAPI openApi() {
.bearerFormat("JWT")
);

Server apiServer = new Server();
apiServer.setUrl("https://api.commitato.site");

Server server = new Server();
server.setUrl("/");

return new OpenAPI()
.addServersItem(new Server().url("/"))
.addSecurityItem(securityRequirement)
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ jwt:
aes-secret: ${AES_SECRET}
iv-secret: ${IV_SECRET}

domain-uri: ${DOMAIN_URI}
domain-uri: "https://api.commitato.com"
4 changes: 2 additions & 2 deletions src/main/resources/application-local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ spring:
datasource:
url: jdbc:mysql://localhost:3306/commitato
username: root
password: 1220
password:
driver-class-name: com.mysql.cj.jdbc.Driver
jpa:
show-sql: true
Expand Down Expand Up @@ -32,4 +32,4 @@ jwt:
aes-secret: ${AES_SECRET}
iv-secret: ${IV_SECRET}

domain-uri: ${DOMAIN_URI}
domain-uri: "http://localhost:8080"

0 comments on commit 6bf63ad

Please sign in to comment.