How to configure port for a Spring Boot application

前端 未结 30 1777
名媛妹妹
名媛妹妹 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:20

    1. As everyone said, you can specify in application.properties
      server.port = 9000 (could be any other value)

    2. If you are using spring actuator in your project, by default it points to
      8080, and if you want to change it, then in application.properties mention
      management.port = 9001 (could be any other value)

提交回复
热议问题