728x90
반응형
이제 사용해보기 !
JHipster 환경 구축
자바 11, Node.js, JHipster 를 설치해야한다. (mac 기준)
brew install jhipster
JHipster에서 마이크로서비스 애플리케이션을 만드는 순서는 이러하다.
1. 게이트웨이 생성
2. 레지스트리 생성
3. 마이크로서비스 생성
4. 생성한 마이크로서비스에 엔티티 생성
5. 생성된 엔티티를 게이트웨이가 인식할 수 있도록 게이트웨이에 등록
(예제) 간단한 CRUD 만들기!
게이트웨이 생성
#gateway 폴더 생성
mkdir gateway
cd gateway
#gateway 폴더를 JHipster프로젝트로 설정 (프론트엔드 vue.js)
jhipster --blueprints vuejs --skip-checks
애플리케이션 옵션을 묻는 질문에서 이제 대답을 하면 된다!
? What is the base name of your application? gateway
? Which *type* of application would you like to create? Microservice application
? What is your default Java package name? com.my.gateway
? Would you like to use Maven or Gradle for building the backend? Maven
? Do you want to make it reactive with Spring WebFlux? No
? As you are running in a microservice architecture, on which port would like your server to run? It should be unique to avoid port conflicts. 8080
? Which service discovery server do you want to use? JHipster Registry (legacy, uses Eureka, provides Spring Cloud Config support)
? Which *type* of authentication would you like to use? JWT authentication (stateless, with a token)
? Do you want to generate a feign client? Yes
? Besides JUnit, which testing frameworks would you like to use?
? Which *type* of database would you like to use? SQL (H2, PostgreSQL, MySQL, MariaDB, Oracle, MSSQL)
? Which *production* database would you like to use? MariaDB
? Which *development* database would you like to use? H2 with in-memory persistence
? Which cache do you want to use? (Spring cache abstraction) Hazelcast (distributed cache, for multiple nodes, supports rate-limiting for gateway applications)
? Do you want to use Hibernate 2nd level cache? Yes
? Which other technologies would you like to use?
? Which *framework* would you like to use as microfrontend? Vue
? Besides Jest/Vitest, which testing frameworks would you like to use?
? Do you want to generate the admin UI? Yes
? Would you like to use a Bootswatch theme (https://bootswatch.com/)? Default JHipster
? Would you like to enable internationalization support? Yes
? Please choose the native language of the application English
? Please choose additional languages to install
그러면 레지스트리와 게이트웨이가 생성된다.
레지스트리 및 게이트 웨이 실행
gateway directory 내에서 아래 명령을 실행한다.
레지스트리가 도커 컨테이너로 제공되기 때문에 도커 컴포즈로 실행한다!
docker-compose -f src/main/docker/jhipster-registry.yml up
레지스트리 실행 완!
그리고 새로운 터미널을 열어서 게이트웨이도 실행한다.
mvn spring-boot:run
* 근데 이제 여기서 갑자기 문제가 생김 ;; 게이트 웨이 오류 해결 중이다
728x90
반응형
'Tech > Spring | Spring Boot' 카테고리의 다른 글
[SpringBootJPA] 카카오페이 결제API (결제취소) (0) | 2024.08.01 |
---|---|
[SpringBootJPA] 카카오페이 결제API (단건결제) (0) | 2024.07.29 |
[JHipster] JHipster란? (JHipster 사용해보기) 1 (0) | 2024.07.04 |
[SpringBoot] JUnit 4 ? JUnit 5 ? (SpringBoot3에서 JUnit4 적용하기) (0) | 2024.06.07 |
[Swagger] Springdoc + SpringBoot 설정 (0) | 2024.05.16 |
댓글