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:
Assert an Exception is Thrown in JUnit 4 and 5
Java Program to Implement D-ary-Heap
Java Program to Implement Hash Tree
Java Program to Use Dynamic Programming to Solve Approximate String Matching
Java Program to Implement Direct Addressing Tables
Java Program to Find Transitive Closure of a Graph
Spring Boot - Bootstrapping
Introduction to Project Reactor Bus
Java Program to find the peak element of an array using Binary Search approach
Functional Interfaces in Java 8
MyBatis with Spring
Quick Guide to java.lang.System
Feign – Tạo ứng dụng Java RESTful Client
Java Program to Construct an Expression Tree for an Prefix Expression
Java Program to find the number of occurrences of a given number using Binary Search approach
Custom JUnit 4 Test Runners
Java Program to Implement ArrayBlockingQueue API
Lập trình hướng đối tượng (OOPs) trong java
A Guide to EnumMap
Java Program to Check the Connectivity of Graph Using BFS
Java Program to Implement Dijkstra’s Algorithm using Queue
Phân biệt JVM, JRE, JDK
Comparing Long Values in Java
Java Program to Perform Quick Sort on Large Number of Elements
Spring Cloud AWS – S3
Redirect to Different Pages after Login with Spring Security
Java Program to Check if any Graph is Possible to be Constructed for a Given Degree Sequence
Java Program to Implement Gale Shapley Algorithm
Java Program to Perform Insertion in a 2 Dimension K-D Tree
Java Program to Implement Self Balancing Binary Search Tree
Java Program to Permute All Letters of an Input String
Java Program to Implement Weight Balanced Tree