how to change default port in spring boot
To change the default port in a Spring Boot application, follow these steps:
Open the
application.properties
file in your project'ssrc/main/resources
directory. If the file doesn't exist, create it.Add the following line to the
application.properties
file:server.port=8081
Replace8081
with the desired port number you want to use.Save the
application.properties
file.Restart your Spring Boot application for the changes to take effect.
By adding the server.port
property in the application.properties
file and specifying the desired port number, you can change the default port used by the Spring Boot application.