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:
A Guide to TreeMap in Java
Java Program to Implement Naor-Reingold Pseudo Random Function
Java Program to Implement Floyd-Warshall Algorithm
Java Program to Implement Flood Fill Algorithm
Updating your Password
Creating Docker Images with Spring Boot
The Registration API becomes RESTful
Java Program to Implement the Binary Counting Method to Generate Subsets of a Set
Creating a Generic Array in Java
Java Program to Implement Doubly Linked List
Hướng dẫn Java Design Pattern – Null Object
How to Count Duplicate Elements in Arraylist
Spring Cloud AWS – RDS
Java Program to Represent Graph Using Incidence List
Java Program to Check Whether a Directed Graph Contains a Eulerian Cycle
How to Convert List to Map in Java
Stack Memory and Heap Space in Java
Java Program to Implement Patricia Trie
Use Liquibase to Safely Evolve Your Database Schema
Java Program to Describe the Representation of Graph using Incidence List
Java Program to Implement Leftist Heap
Java Program to Use Above Below Primitive to Test Whether Two Lines Intersect
Checked and Unchecked Exceptions in Java
Java Program to Find Path Between Two Nodes in a Graph
Collection trong java
Java Program to Solve any Linear Equation in One Variable
Java – Reader to String
Java Program to Perform Searching Based on Locality of Reference
Java Program to Represent Graph Using Adjacency List
Java Program to Create a Minimal Set of All Edges Whose Addition will Convert it to a Strongly Conne...
Java 8 Streams peek() API
JUnit 5 @Test Annotation