Spring Boot: Change Port for Web Application

后端 未结 6 1764
无人共我
无人共我 2021-02-20 08:41

I am currently trying to create a web application with Spring Boot. I need to host my application to localhost:8081. How do I change the port?

6条回答
  •  礼貌的吻别
    2021-02-20 09:33

    If you're using STS, you can do it following below steps:

    • Go to Boot Dashboard view, you'll see your Boot app, say myApp1

    • Right click and click on Open Config. This should open Run Time Configuration section.
    • Go to Argument tab and add parameter server.port=, like in the example below, a custom port 9091 is added.

    • Start the app and if everything is good, you'll see the desired port on Boot dashboard.

提交回复
热议问题