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:
Java Program for Douglas-Peucker Algorithm Implementation
Spring Security Basic Authentication
Guide to Guava Multimap
Hashing a Password in Java
Hướng dẫn Java Design Pattern – Prototype
Setting the Java Version in Maven
Java Program to Find Inverse of a Matrix
Java Program to Solve TSP Using Minimum Spanning Trees
Guide to BufferedReader
Spring Boot Security Auto-Configuration
OAuth2.0 and Dynamic Client Registration
Using JWT with Spring Security OAuth
Java String Conversions
Java Program to Find the Peak Element of an Array O(n) time (Naive Method)
The Difference Between map() and flatMap()
Java Program to Implement Hash Tables Chaining with Binary Trees
Tạo ứng dụng Java RESTful Client với thư viện Retrofit
Tránh lỗi NullPointerException trong Java như thế nào?
Java Program to Compute Determinant of a Matrix
Java Program to Implement Red Black Tree
Spring Data Reactive Repositories with MongoDB
Java Program to Perform Right Rotation on a Binary Search Tree
Hướng dẫn sử dụng Lớp FilePermission trong java
Java – InputStream to Reader
Check If a File or Directory Exists in Java
@DynamicUpdate with Spring Data JPA
Thực thi nhiều tác vụ cùng lúc như thế nào trong Java?
Guide to Selenium with JUnit / TestNG
Mệnh đề if-else trong java
Java Program to Test Using DFS Whether a Directed Graph is Strongly Connected or Not
Converting Between an Array and a Set in Java
Different Ways to Capture Java Heap Dumps