Skip to content

5 项目的简单配置

5.1 Controller

在启动类所在的包或者子包

5.2 Springboot的配置文件

SpringBoot的配置文件,可以以properties、yaml、yml为扩展名,名字:application

  • application.properties

    键值对的形式,key=value server.port=9090

properties
server.port=80
  • application.yml

​ 以树形结构书写,有上下级关系 ,最终会解析成 properties

yaml
server:
  port: 9090

其他通用的默认配置参考:

https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-application-properties.html#common-application-properties-server

Released under the MIT License.