Spring Boot:更改Web应用程序的端口

Spring Boot:更改Web应用程序的端口,第1张

Spring Boot:更改Web应用程序端口

实际上,您想要更改,

server.port
并且可以按照http://docs.spring.io/spring-
boot/docs/current/reference/htmlsingle/#boot-features-external-
config

中所述的许多不同方式进行更改

例子:

  • 在您的application.properties中(在jar内或罐外)
  • 命令行

java -Dserver.port = $ PORT -jar target / demo-0.0.1-SNAPSHOT.jar

以及更多



欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/zaji/5675961.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-16

发表评论

登录后才能评论

评论列表(0条)

保存