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:
StringBuilder vs StringBuffer in Java
Java Program to Implement Branch and Bound Method to Perform a Combinatorial Search
Spring Boot - CORS Support
Java Program to Find Minimum Element in an Array using Linear Search
Spring Boot Annotations
Java Program to Implement Graph Coloring Algorithm
Removing all Nulls from a List in Java
Using a Spring Cloud App Starter
Giới thiệu java.io.tmpdir
Java Program to implement Bit Matrix
Date Time trong Java 8
Java Program to Implement Find all Cross Edges in a Graph
So sánh HashMap và Hashtable trong Java
Guava CharMatcher
Send email with JavaMail
Java Program to Implement Sparse Matrix
Spring Boot - Cloud Configuration Client
Convert Character Array to String in Java
Java Program to Represent Graph Using Incidence Matrix
Java String to InputStream
Hướng dẫn Java Design Pattern – Transfer Object
Java Program to Solve the 0-1 Knapsack Problem
Java Program to Implement Splay Tree
Giới thiệu Java 8
Spring Boot Gradle Plugin
Java Program to Implement Stack
Java 8 and Infinite Streams
Java Program to Find Number of Articulation points in a Graph
Deque và ArrayDeque trong Java
Introduction to Liquibase Rollback
Java Program to Implement Binomial Heap
Java Program to Implement Park-Miller Random Number Generation Algorithm