Skip to content

Commit

Permalink
update readme add connection config notes
Browse files Browse the repository at this point in the history
  • Loading branch information
tomsun28 committed May 20, 2024
1 parent 416cbfc commit 4d69f7b
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
38 changes: 38 additions & 0 deletions applications/hertzbeat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,41 @@ yarn start
```
6. Access `http://localhost:4200` to start, account `admin/hertzbeat`
## Custom Database Configuration
### Custom Local or Prod Env Configuration
Modify the `application.yml` file in the `manager` module `manager/src/main/resources`
```yaml
spring:
config:
activate:
on-profile: prod

datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password:
url: jdbc:mysql://localhost:2881/hertzbeat?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf-8&useSSL=false
hikari:
max-lifetime: 120000
```
### Custom Test Env Configuration
This if for the test environment, `mvn clean test`
Modify the `application-test.yml` file in the `manager` module `manager/src/main/resources`
```yaml
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password:
url: jdbc:mysql://localhost:2881/test?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf-8&useSSL=false
hikari:
max-lifetime: 120000
```
38 changes: 38 additions & 0 deletions applications/hertzbeat/README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,41 @@ yarn start
```
6. Access `http://localhost:4200` to start, account `admin/hertzbeat`
## Custom Database Configuration
### Custom Local or Prod Env Configuration
Modify the `application.yml` file in the `manager` module `manager/src/main/resources`
```yaml
spring:
config:
activate:
on-profile: prod

datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password:
url: jdbc:mysql://localhost:2881/hertzbeat?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf-8&useSSL=false
hikari:
max-lifetime: 120000
```
### Custom Test Env Configuration
This if for the test environment, `mvn clean test`
Modify the `application-test.yml` file in the `manager` module `manager/src/main/resources`
```yaml
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password:
url: jdbc:mysql://localhost:2881/test?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf-8&useSSL=false
hikari:
max-lifetime: 120000
```

0 comments on commit 4d69f7b

Please sign in to comment.