项目名称

spring: application: name: demo

端口号

server: port: 8080

数据库配置

spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://localhost:3306/demo?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&useSSL=false username: root password: 123456

MyBatis配置

mybatis: mapper-locations: classpath:mapper/*.xml configuration: map-underscore-to-camel-case: true

日志配置

logging: level: root: info org.springframework: info org.mybatis: info com.example: debug

静态文件配置

spring: resources: static-locations: classpath:/static/

Vue前端代理

server: servlet: context-path: / forward-headers-strategy: NATIVE tomcat: basedir: target/tomcat compression: enabled: true mime-types: text/html,text/xml,text/plain,text/css,text/javascript,application/javascript,application/json,image/svg+xml,image/gif,image/png,image/jpeg min-response-size: 2048 proxy: context-path: /api routes: - id: vue uri: http://localhost:8081 predicates: - Path=/vue/** filters: - RewritePath=/vue/(?.*), /${segment} metadata: - key: preserve-host-header value: true

Redis配置

spring: redis: host: localhost port: 6379 password: null timeout: 5000 jedis: pool: max-active: 1000 max-idle: 8 max-wait: -1 min-idle: 0

来一段简单的springboot项目yml配置文件项目使用SSM前端使用vue数据库为MySQL8日志使用slf4j并给配置内容予以注释

原文地址: https://www.cveoy.top/t/topic/Y3R 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录