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 Perform Naive String Matching
Guide to Dynamic Tests in Junit 5
Một số tính năng mới về xử lý ngoại lệ trong Java 7
Spring Boot - Google Cloud Platform
Hướng dẫn Java Design Pattern – Memento
Java Program to Implement ArrayList API
Java Program to Implement Pairing Heap
Biến trong java
Disable DNS caching
Class Loaders in Java
Explain about URL and HTTPS protocol
Java Program to Implement JobStateReasons API
Dockerizing a Spring Boot Application
Java Program to Implement Quick Sort with Given Complexity Constraint
Java Program to Implement Kosaraju Algorithm
Java Program to Find the Edge Connectivity of a Graph
Java Program to Find SSSP (Single Source Shortest Path) in DAG (Directed Acyclic Graphs)
Java Stream Filter with Lambda Expression
Object Type Casting in Java
Hướng dẫn sử dụng luồng vào ra nhị phân trong Java
Hướng dẫn Java Design Pattern – Proxy
Java 8 Predicate Chain
Java Program to Implement Binary Heap
So sánh ArrayList và Vector trong Java
Spring Boot - Flyway Database
Java InputStream to String
Java Program to Implement Sparse Matrix
Java Program to Implement Min Heap
Java Program to Find the Minimum Element of a Rotated Sorted Array using Binary Search approach
Introduction to Liquibase Rollback
Java Program to Find Shortest Path Between All Vertices Using Floyd-Warshall’s Algorithm
Java Program to Find Path Between Two Nodes in a Graph