Table of Contents
Spring Boot lets you to run the same application more than once on a different port number. In this chapter, you will learn about this in detail. Note that the default port number 8080.
1. Custom Port
In the application.properties file, we can set custom port number for the property server.port
server.port = 9090
In the application.yml file, you can find as follows −
server: port: 9090
Random Port
In the application.properties file, we can set random port number for the property server.port
server.port = 0
In the application.yml file, you can find as follows −
server: port: 0
Note − If the server.port number is 0 while starting the Spring Boot application, Tomcat uses the random port number.
Related posts:
Custom Error Pages with Spring MVC
A Guide to Java SynchronousQueue
Java Program to Find Median of Elements where Elements are Stored in 2 Different Arrays
Testing in Spring Boot
Tổng quan về ngôn ngữ lập trình java
Optional trong Java 8
Tìm hiểu về xác thực và phân quyền trong ứng dụng
Java Program to Implement Gauss Jordan Elimination
A Guide to Spring Cloud Netflix – Hystrix
Apache Commons Collections MapUtils
Java Program to Implement Ternary Heap
Java Program to Find a Good Feedback Vertex Set
OAuth2 for a Spring REST API – Handle the Refresh Token in AngularJS
Java Program to Implement Fenwick Tree
Spring Boot - Quick Start
Java toString() Method
Chuyển đổi giữa các kiểu dữ liệu trong Java
Introduction to Spring MVC HandlerInterceptor
Java Program to Perform Right Rotation on a Binary Search Tree
Java Program for Topological Sorting in Graphs
Java Program to Represent Graph Using Adjacency List
Làm thế nào tạo instance của một class mà không gọi từ khóa new?
Java Program to Check Whether an Undirected Graph Contains a Eulerian Cycle
Converting Strings to Enums in Java
Java Program to Implement Flood Fill Algorithm
Instance Profile Credentials using Spring Cloud
Creating a Generic Array in Java
Functional Interface trong Java 8
Introduction to Spliterator in Java
Reactive WebSockets with Spring 5
Java Program to Implement Sieve Of Atkin
New Features in Java 10