[MSA] Config Git Repository

jineey·2024년 11월 21일

MSA

목록 보기
25/36

Remote Git Repository

📌 개요

기존의 Config 파일을 설정 파일의 주소를 입력하여 연결시켜놨는데,
이를 Git Repository의 주소로 변경

📌 소스코드

  • 설정파일 경로

config-service

  • application.yml 수정
spring:
  application:
    name: config-service
  cloud:
    config:
      server:
        git:
#          uri: file://C:\Users\admin\yyyy << 기존
          uri: https://github.com/xxx/xxx <<git 주소 (.git은 삭제)
           search-paths: #특정 디렉터리 설정
            - 'config-files' #디텍터리명
            - '{application}'

server:
  port: 8888

URI 찾는 방법
1. 해당하는 git Repository에 접속
🔗 링크: https://github.com/
2. <> Code 클릭 -> 복사 버튼 클릭

📌 실행결과

  • 127.0.0.1:8888/ecommerce/dev 실행

-> name 부분에 설정 파일이 담긴 경로가 출력됨

profile
새싹 개발자

0개의 댓글