From 20f7cf481292cee98a1d4867dabb7391cf955530 Mon Sep 17 00:00:00 2001 From: johnniang <1340692778@qq.com> Date: Thu, 31 Jan 2019 21:14:52 +0800 Subject: [PATCH] Add test, dev and prod configuration file --- src/main/resources/application-dev.yaml | 61 +++++++++++++++++++++++ src/main/resources/application-prod.yaml | 61 +++++++++++++++++++++++ src/main/resources/application-test.yaml | 46 ++++++++++++++++++ src/main/resources/application.yaml | 62 +----------------------- 4 files changed, 170 insertions(+), 60 deletions(-) create mode 100755 src/main/resources/application-dev.yaml create mode 100755 src/main/resources/application-prod.yaml create mode 100755 src/main/resources/application-test.yaml diff --git a/src/main/resources/application-dev.yaml b/src/main/resources/application-dev.yaml new file mode 100755 index 000000000..5c8c0bea7 --- /dev/null +++ b/src/main/resources/application-dev.yaml @@ -0,0 +1,61 @@ +server: + port: 8090 + use-forward-headers: true + undertow: + io-threads: 2 + worker-threads: 36 + buffer-size: 1024 + directBuffers: true + servlet: + session: + timeout: 86400s +spring: + datasource: + type: com.zaxxer.hikari.HikariDataSource + + # H2database 配置 + driver-class-name: org.h2.Driver + url: jdbc:h2:file:~/halo/halo-dev + username: admin + password: 123456 + + #MySql配置 +# driver-class-name: com.mysql.cj.jdbc.Driver +# url: jdbc:mysql://127.0.0.1:3306/halodb?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai +# username: root +# password: 123456 + + h2: + console: + settings: + web-allow-others: true + path: /h2-console + enabled: true + jpa: + hibernate: + ddl-auto: update + show-sql: true + freemarker: + allow-request-override: false + cache: false + check-template-location: true + charset: utf-8 + content-type: text/html + expose-request-attributes: false + expose-session-attributes: false + expose-spring-macro-helpers: true + suffix: .ftl + settings: + auto_import: /spring.ftl as spring + servlet: + multipart: + max-file-size: 10MB + max-request-size: 10MB + + # 多语言资源文件路径 + messages: + basename: i18n/messages +logging: + file: ./logs/log.log + + diff --git a/src/main/resources/application-prod.yaml b/src/main/resources/application-prod.yaml new file mode 100755 index 000000000..d5f36e489 --- /dev/null +++ b/src/main/resources/application-prod.yaml @@ -0,0 +1,61 @@ +server: + port: 8090 + use-forward-headers: true + undertow: + io-threads: 2 + worker-threads: 36 + buffer-size: 1024 + directBuffers: true + servlet: + session: + timeout: 86400s +spring: + datasource: + type: com.zaxxer.hikari.HikariDataSource + + # H2database 配置 + driver-class-name: org.h2.Driver + url: jdbc:h2:file:~/halo/halo + username: admin + password: 123456 + + #MySql配置 +# driver-class-name: com.mysql.cj.jdbc.Driver +# url: jdbc:mysql://127.0.0.1:3306/halodb?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai +# username: root +# password: 123456 + + h2: + console: + settings: + web-allow-others: true + path: /h2-console + enabled: true + jpa: + hibernate: + ddl-auto: update + show-sql: false + freemarker: + allow-request-override: false + cache: false + check-template-location: true + charset: utf-8 + content-type: text/html + expose-request-attributes: false + expose-session-attributes: false + expose-spring-macro-helpers: true + suffix: .ftl + settings: + auto_import: /spring.ftl as spring + servlet: + multipart: + max-file-size: 10MB + max-request-size: 10MB + + # 多语言资源文件路径 + messages: + basename: i18n/messages +logging: + file: ./logs/log.log + + diff --git a/src/main/resources/application-test.yaml b/src/main/resources/application-test.yaml new file mode 100755 index 000000000..abcb4a717 --- /dev/null +++ b/src/main/resources/application-test.yaml @@ -0,0 +1,46 @@ +server: + use-forward-headers: true + undertow: + io-threads: 2 + worker-threads: 36 + buffer-size: 1024 + directBuffers: true + servlet: + session: + timeout: 86400s +spring: + datasource: + type: com.zaxxer.hikari.HikariDataSource + # H2database 配置 + driver-class-name: org.h2.Driver + url: jdbc:h2:file:~/halo/halo-test + username: admin + password: 123456 + jpa: + hibernate: + ddl-auto: update + show-sql: true + freemarker: + allow-request-override: false + cache: false + check-template-location: true + charset: utf-8 + content-type: text/html + expose-request-attributes: false + expose-session-attributes: false + expose-spring-macro-helpers: true + suffix: .ftl + settings: + auto_import: /spring.ftl as spring + servlet: + multipart: + max-file-size: 10MB + max-request-size: 10MB + + # 多语言资源文件路径 + messages: + basename: i18n/messages +logging: + file: ./logs/log.log + + diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index d5f36e489..90385b2bc 100755 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -1,61 +1,3 @@ -server: - port: 8090 - use-forward-headers: true - undertow: - io-threads: 2 - worker-threads: 36 - buffer-size: 1024 - directBuffers: true - servlet: - session: - timeout: 86400s spring: - datasource: - type: com.zaxxer.hikari.HikariDataSource - - # H2database 配置 - driver-class-name: org.h2.Driver - url: jdbc:h2:file:~/halo/halo - username: admin - password: 123456 - - #MySql配置 -# driver-class-name: com.mysql.cj.jdbc.Driver -# url: jdbc:mysql://127.0.0.1:3306/halodb?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai -# username: root -# password: 123456 - - h2: - console: - settings: - web-allow-others: true - path: /h2-console - enabled: true - jpa: - hibernate: - ddl-auto: update - show-sql: false - freemarker: - allow-request-override: false - cache: false - check-template-location: true - charset: utf-8 - content-type: text/html - expose-request-attributes: false - expose-session-attributes: false - expose-spring-macro-helpers: true - suffix: .ftl - settings: - auto_import: /spring.ftl as spring - servlet: - multipart: - max-file-size: 10MB - max-request-size: 10MB - - # 多语言资源文件路径 - messages: - basename: i18n/messages -logging: - file: ./logs/log.log - - + profiles: + active: prod \ No newline at end of file