Skip to content

Commit

Permalink
Merge pull request #55 from kakao-tech-campus-2nd-step3/feat/#44-toke…
Browse files Browse the repository at this point in the history
…nRefresh

[Chore] redis.yaml 파일로 config 관리
  • Loading branch information
sanghee0820 authored Oct 11, 2024
2 parents c0e0fbe + 77b364e commit 348f9b9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/java/team7/inplace/security/config/RedisConfig.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package team7.inplace.security.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisStandaloneConfiguration;
Expand All @@ -10,9 +11,16 @@
@Configuration
public class RedisConfig {

@Value("${redis.db.url}")
private String redisDBUrl;

@Value("${redis.db.port}")
private Integer redisDBPort;

@Bean
LettuceConnectionFactory redisConnectionFactory() {
return new LettuceConnectionFactory(new RedisStandaloneConfiguration("localhost", 6379));
return new LettuceConnectionFactory(
new RedisStandaloneConfiguration(redisDBUrl, redisDBPort));
}

@Bean
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/application-redis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
redis:
db:
url: ${REDIS_DATABASE_URL}
port: ${REDIS_DATABASE_PORT}
1 change: 1 addition & 0 deletions src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ spring:
- classpath:application-youtube.yaml
- classpath:application-kakao.yaml
- classpath:application-db.yaml
- classpath:application-redis.yaml
- optional:file:.env[.properties]

0 comments on commit 348f9b9

Please sign in to comment.