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 Kosaraju Algorithm
Spring Security Logout
Getting Started with GraphQL and Spring Boot
Biểu thức Lambda trong Java 8 – Lambda Expressions
Join and Split Arrays and Collections in Java
Jackson Unmarshalling JSON with Unknown Properties
Hướng dẫn Java Design Pattern – Bridge
Java Program to Remove the Edges in a Given Cyclic Graph such that its Linear Extension can be Found
Java Program to Find Inverse of a Matrix
Java Program to Search Number Using Divide and Conquer with the Aid of Fibonacci Numbers
Java Program to Check Whether a Weak Link i.e. Articulation Vertex Exists in a Graph
Implementing a Runnable vs Extending a Thread
Constructor Injection in Spring with Lombok
Java Program to Find MST (Minimum Spanning Tree) using Kruskal’s Algorithm
Ép kiểu trong Java (Type casting)
How to Return 404 with Spring WebFlux
Guide to @JsonFormat in Jackson
Java Program to Implement D-ary-Heap
Java Program to Implement Efficient O(log n) Fibonacci generator
Java Program to Implement Splay Tree
Merging Two Maps with Java 8
Java Program to Implement Knight’s Tour Problem
Java Program to Use Boruvka’s Algorithm to Find the Minimum Spanning Tree
Java Program to Implement Horner Algorithm
String Operations with Java Streams
Hướng dẫn Java Design Pattern – MVC
Java Program to Implement Bubble Sort
Overview of Spring Boot Dev Tools
Java Program to Implement Depth-limited Search
An Intro to Spring Cloud Zookeeper
Create a Custom Auto-Configuration with Spring Boot
Java Program to Find MST (Minimum Spanning Tree) using Prim’s Algorithm