How to configure port for a Spring Boot application

前端 未结 30 1272
名媛妹妹
名媛妹妹 2020-11-22 13:36

How do I configure the TCP/IP port listened on by a Spring Boot application, so it does not use the default port of 8080.

30条回答
  •  悲哀的现实
    2020-11-22 14:13

    By default, spring-web module provides an embedded tomcat server that is running under the port number 8080. If you need to change the port number of the application then go to application.properties file and configure the port number by using server.port property.

      server.port= 9876
    

    then your application is running under the port 9876.

提交回复
热议问题