美文网首页程序员springboot
配置文件application.yml或application.

配置文件application.yml或application.

作者: codewang | 来源:发表于2017-04-28 11:19 被阅读0次

springboot的配置都在一个叫application.yml或是application.properties里面,如图



在这里面可以配置我们想要的配置参数,基于springboot的web项目,我们可以配置运行时http监听的端口以及应用的contextpath

server:
   port: 8888  #设定http监听端口
   context-path: /demo #设定应用的context-path

运行web应用,就会监听8888端口
我们这样访问项目:http://localhost:8888/demo/hello

相关文章

网友评论

    本文标题:配置文件application.yml或application.

    本文链接:https://www.haomeiwen.com/subject/tqmozttx.html