Spring Boot Admin Server, Client config 설정하기

이미지
 Spring Boot로 많은 프로젝트를 진행하게 됩니다. 많은 모니터링 도구가 있지만, Spring Boot 어플리케이션을 쉽게 모니터링 할 수 있는 방법을 소개하려고 합니다.   코드 중심으로 살펴보겠습니다. 1. 어드민 서버 구축 1-1. 디펜던시 추가 dependencies { // https://mvnrepository.com/artifact/de.codecentric/spring-boot-admin-starter-server implementation 'de.codecentric:spring-boot-admin-starter-server:2.5.4' } 1-2. 어드민 서버 설정 활성화 @SpringBootApplication @EnableAdminServer public class ServerApplication { public static void main (String[] args) { SpringApplication. run (ServerApplication. class, args) ; } } EnableAdminServer를 하면 됩니다. 2. 클라이언트 서버 설정  예제는 book-client, member-client 2가지 클라이언트, member-client가 2개의 인스턴스 실행으로 작성했습니다.  2-1 디펜던시 추가 dependencies { // https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web implementation 'org.springframework.boot:spring-boot-starter-web:2.5.4' // https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-actuator implementation 'org.spring...

AWS Amplify 이용하여 React 프로젝트 자동 빌드 배포

 AWS Amplify 는 클라이언트 애플리케이션 개발을 하도록 지원하는 도구입니다. 자세한 내용은 링크를 참고 부탁합니다.

https://aws.amazon.com/ko/amplify/


Amplify 구성

1. 새로운 앱 생성

2. 연결할 저장소 선택

연결할 저장소 선택







3. 리포지토리, 브랜치 선택

리포지토리, 브랜치 선택





이때 자신의 리액트 프로젝트를 선택합니다.


4. 빌드 설정 구성은 특별히 변경할 필요없음.

5. 등록이 완료되면 자동을 빌드 배포가 진행됩니다. 이후 소스코드 변경이 있을 때 자동으로 프로젝트가 배포됩니다.

빌드 배포 과정 이미지







환경  변수 설정하기

1. 리액트에서 환경 변수 설정하기

리액트 환경 변수







상위 폴더에 .env 파일 생성하고 원하는 설정 추가

사용은 process.env. 를 통하여 합니다.

axios.defaults.baseURL = process.env.REACT_APP_API_URL


2. Amplify 환경 변수 추가

앱 설정 > 환경 변수 메뉴

Amplify 환경 변수






이미지와 같이 환경 변수를 추가하면 앱이 배포될때 포함되어 배포됩니다.


댓글

이 블로그의 인기 게시물

Spring boot redis cache config

Spring boot redis RedisTemplate

MySQL PK 중복 (duplicate key ) 해결 방법