我在 Spring Boot on localhost 上有应用程序,url 是:127.0.0.1:8080
。是否可以省略端口?我的意思是我想写127.0.0.1
并得到这个网站。
在文件 application.properties
中,设置
server.port=80
然后,您可以在以下位置访问网络应用程序: http://127.0.0.1
参考: http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#production-ready-customizing-management-server-port