spring_003_sever_port

AMJ·2023년 5월 15일
0

spring_log

목록 보기
3/3

테스트를 위해서 2개이상의 서버를 띄울시

  • src/main/java/<project_name>Application.java 파일에서
@SpringBootApplication
public class RemoteService {
    public static void main(String[] args) {
        // 이미 작성된 application.properties =8080 설정값 이 외에 (추가로)다른 것을 쓰고 싶다면 아래처럼 System.setProperty 를 사용하면 된다.
        System.setProperty("server.port", "8081");
		// 멀티커넥트(다중 포트) 설정
		System.setProperty("server.port.http", "8082");
        
        SpringApplication.run(RemoteService.class, args);
    }
}

참고 사이트

profile
재미있는 것들

0개의 댓글