SpringBoot web project configuration file

Some configurations used when learning springboot.

application.yml

spring:
  profiles:
    active: dev
  #Database configuration
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://127.0.0.1:3306/yourDatabaseName?useSSL=true&serverTimezone=UTC
    username: root
    password: yourDatabasePswd
  thymeleaf:
    # This is the configuration template path, the default is templates
    prefix: classpath:/templates/
    suffix: .html
    # template pattern
    The default value of #spring.thymeleaf.mode is HTML5, which is actually a very strict check. Changing to LEGACYHTML5 can get a more friendly and friendly format requirement.
    mode: LEGACYHTML5
    encoding: UTF-8
    # This development configuration is false, to avoid changing the template and restarting the server
    cache: false
    content-type: text/html
    enabled: true
  mvc:
    static-path-pattern: /**
  resources:
    static-locations: classpath:/static/
  # Set the maximum upload file size
  http:
    multipart:
      max-file-size: 20MB
      max-request-size: 20MB
  # Enable hot publishing
  devtools:
    livereload:
      enabled: true
  # The location and name of the configuration file
  config:
    location: classpath:/config/ #This is also the default configuration
    name: application
  # REDIS (RedisProperties)
  say again:
    database: 0 # Redis database index (default 0)
    host: 127.0.0.1 # Redis server address
    port: 6379 # Redis server connection port
    password: # Redis server connection password (default is empty)
    pool:
      max-active: 8 # The maximum number of connections in the connection pool (a negative value means no limit)
      max-wait: -1 # The maximum blocking wait time of the connection pool (use a negative value to indicate no limit)
      max-idle: 8 # The maximum idle connection in the connection pool
      min-idle: 0 # The minimum idle connection in the connection pool
    timeout: 0 # connection timeout (milliseconds)
# reset the banner position
banner:
  location: classpath:config/banner.txt
# custom constant
application:
  version: 0.0.1-SNAPSHOT
  formatted-version: (v0.0.1-SNAPSHOT)
application-dev.yml
server:
  port: 8080
  context-path: /hy-web
mybatis:
  mapper-locations: classpath:mapper/*Mapper.xml
  config-location: classpath:config/mybatis-config.xml
spring:
  rabbitmq: # RabbitMQ配置
    host: 127.0.0.1
    port: 5672
    username: name
    password: pswd
  data: #Connection authentication mongodb
    mongodb:
      uri: mongodb://127.0.0.1:27017/dbName
#      uri: mongodb://root:[email protected]:27017/dbName
#logging:
# config: classpath:config/logback-web.xml #logback configuration file


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325422328&siteId=291194637