构建与配置
个人博客系统的后端框架的构建,使用springboot + JPA
1. 引入Spring boot模块
- web
- Thymeleaf
- JPA
- MySQL
- Aspects
- DevTools
2.application.yml配置
- yml总配置
spring:
thymeleaf:
mode: HTML
prefix:
classpath: /templates
profiles:
active: dev //不同环境模式选择
- 开发环境yml配置
spring:
jpa:
hibernate:
ddl-auto: update
show-sql: true
datasource:
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://localhost:3306/blog?useUnicode=true&characterEncoding=utf-8
username: root
password: root
logging:
level:
root: info
com.lys: debug
file:
path: log/blog-dev.log
- 生产环境yml配置
spring:
jpa:
hibernate:
ddl-auto: none
show-sql: true
datas