
백엔드(Spring boot) 서버에 환경변수 등록하여 사용하기

·
쿠버네티스/cka
이전 포스팅에서 1.2 까지 진행하기AppController.java 생성하기package com.example.demo;import org.springframework.beans.factory.annotation.Value;import org.springframework.web.bind.annotation.GetMapping;import org.springframework.web.bind.annotation.RestController;@RestControllerpublic class AppController { @Value("${MY_ACCOUNT:default}") // `:` 앞 공백 제거 private String myAccount; @Value("${MY_PASSWORD:..