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 Check if any Graph is Possible to be Constructed for a Given Degree Sequence
Spring RequestMapping
Hướng dẫn Java Design Pattern – Strategy
ExecutorService – Waiting for Threads to Finish
Generating Random Numbers in a Range in Java
Registration with Spring Security – Password Encoding
Guide to PriorityBlockingQueue in Java
Java Program to Perform Matrix Multiplication
Beans and Dependency Injection
Spring Boot Application as a Service
Spring Boot - OAuth2 with JWT
Number Formatting in Java
Rate Limiting in Spring Cloud Netflix Zuul
Spring – Injecting Collections
HttpClient Basic Authentication
Java Program to Implement LinkedBlockingDeque API
Guide to Guava Table
A Guide To UDP In Java
Giới thiệu SOAP UI và thực hiện test Web Service
Collect a Java Stream to an Immutable Collection
Bootstrapping Hibernate 5 with Spring
Java Program to Implement a Binary Search Algorithm for a Specific Search Sequence
Java Program to Create a Balanced Binary Tree of the Incoming Data
LIKE Queries in Spring JPA Repositories
Java Program to Implement Hash Tables with Double Hashing
Java Program to Implement Stack using Two Queues
Introduction to Spring Security Expressions
Java Program to Implement Heap
Simple Single Sign-On with Spring Security OAuth2
Working with Kotlin and JPA
Uploading MultipartFile with Spring RestTemplate
Guide to UUID in Java