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 Queue
Java Program to Implement Warshall Algorithm
Remove the First Element from a List
Java Program to Find Transitive Closure of a Graph
Java Program to Implement Direct Addressing Tables
Java Program to find the maximum subarray sum using Binary Search approach
Send email with SMTPS (eg. Google GMail)
Java Program to find the peak element of an array using Binary Search approach
Java Concurrency Interview Questions and Answers
Spring Boot Actuator
Spring Security with Maven
Introduction to Spring Data JPA
Lớp lồng nhau trong java (Java inner class)
Java Program to Evaluate an Expression using Stacks
Mảng (Array) trong Java
Java Program to Implement Repeated Squaring Algorithm
Java Program to Find All Pairs Shortest Path
Hướng dẫn Java Design Pattern – MVC
Sử dụng Fork/Join Framework với ForkJoinPool trong Java
Overview of the java.util.concurrent
Jackson – Decide What Fields Get Serialized/Deserialized
Introduction to Eclipse Collections
Java Program to Find the Minimum Element of a Rotated Sorted Array using Binary Search approach
Spring’s RequestBody and ResponseBody Annotations
Spring REST with a Zuul Proxy
Các nguyên lý thiết kế hướng đối tượng – SOLID
Java Program to find the maximum subarray sum O(n^2) time(naive method)
Guide to java.util.concurrent.Locks
Java Program to Find the Peak Element of an Array O(n) time (Naive Method)
Introduction to the Java NIO2 File API
Giới thiệu Java Service Provider Interface (SPI) – Tạo các ứng dụng Java dễ mở rộng
Java 8 Streams peek() API