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 to Implement D-ary-Heap
A Guide to System.exit()
Java Program to Check Whether Graph is DAG
Java Program to Generate Random Partition out of a Given Set of Numbers or Characters
DynamoDB in a Spring Boot Application Using Spring Data
A Guide to LinkedHashMap in Java
Deploy a Spring Boot App to Azure
Java Program to Describe the Representation of Graph using Incidence Matrix
Guide to Java OutputStream
Quản lý bộ nhớ trong Java với Heap Space vs Stack
A Quick Guide to Spring MVC Matrix Variables
Java Program to Print only Odd Numbered Levels of a Tree
Converting a List to String in Java
Java Program to Implement Gaussian Elimination Algorithm
Java Program to Implement Rolling Hash
Spring Boot - Batch Service
Guide to the Java Queue Interface
Java Program to Implement Self Balancing Binary Search Tree
Getting Started with Stream Processing with Spring Cloud Data Flow
How to Read a Large File Efficiently with Java
Spring Webflux and CORS
Phương thức tham chiếu trong Java 8 – Method References
Test a REST API with Java
Java Web Services – Jersey JAX-RS – REST và sử dụng REST API testing tools với Postman
JUnit5 Programmatic Extension Registration with @RegisterExtension
Java Program to Solve Set Cover Problem assuming at max 2 Elements in a Subset
Getting the Size of an Iterable in Java
Spring Security Custom AuthenticationFailureHandler
The Guide to RestTemplate
Immutable Map Implementations in Java
Lớp Collectors trong Java 8
Spring Boot - Actuator