Skip to content

Commit 7554157

Browse files
author
litongjava
committed
move json to web
1 parent 2a1766b commit 7554157

28 files changed

+2070
-2066
lines changed

docs/.vuepress/config/sidebar-zh.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
{
1919
"title": "03_配置",
2020
"collapsable": false,
21-
"children": ["03_配置/01.md", "03_配置/02.md", "03_配置/03.md", "03_配置/04.md", "03_配置/05.md", "03_配置/06.md"]
21+
"children": ["03_配置/01.md", "03_配置/02.md", "03_配置/03.md", "03_配置/04.md", "03_配置/05.md"]
2222
},
2323
{
2424
"title": "04_架构",
@@ -49,7 +49,8 @@
4949
"05_web开发/18.md",
5050
"05_web开发/19.md",
5151
"05_web开发/20.md",
52-
"05_web开发/21.md"
52+
"05_web开发/21.md",
53+
"05_web开发/22.md"
5354
]
5455
},
5556
{

docs/zh/03_配置/01.md

+32-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# 配置概览
1+
# 配置
2+
3+
## 配置概览
24

35
- `server.address=127.0.0.1`:指定服务器监听的 IP 地址。此处为本地地址,意味着服务器仅在本机上可访问。
46
- `server.port=8080`:定义服务器监听的端口号。在这里,端口被设置为 8080。
@@ -19,4 +21,32 @@
1921
- `http.multipart.max-file-size`: 设置上传文件的大小
2022
- `app.env`:定义应用的运行环境。根据 `app.env` 的不同值,可以加载不同的配置文件,以适应不同的开发、测试或生产环境。
2123

22-
tio-boot 配置参考源码 com.litongjava.tio.boot.constatns.ConfigKeys
24+
tio-boot 配置参考源码 com.litongjava.tio.boot.constatns.ConfigKeys
25+
26+
## 配置文件
27+
28+
tio-boot 默认支持加载两个配置文件
29+
30+
- src/main/resources/.env 环境变量配置文件,不能提交到 git 中
31+
- src/main/resources/app.properties 其他配置文件
32+
33+
## 常用配置
34+
35+
#### 设置静态文件目录
36+
37+
将 app.properties 中配置
38+
39+
```shell
40+
server.resources.static-locations = classpath:/pages
41+
```
42+
43+
#### 设置文件上传大小
44+
45+
```
46+
# 设置最大请求大小(包含所有文件)单位 字节,这里设置为1G
47+
http.multipart.max-request-size=73741824
48+
# 设置最大文件大小,单位字节,这里设置为1G
49+
http.multipart.max-file-size=73741824
50+
```
51+
52+
将静态文件放到 pages 目录下即可 DefaultHttpRequestHandler 的 processStatic 类会处理静态文件

docs/zh/03_配置/02.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# 通过命令行指定参数
2+
3+
tio-boot 框架的参数查找顺序是,支持所有参数 命令行参数-->环境变量-->配置文件
4+
使用命令行指定参数示例如下
5+
6+
```shell
7+
java -jar paddle-ocr-server-1.0.1.jar --http-port 8080
8+
```

docs/zh/03_配置/03.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
# 通过命令行指定参数
1+
# 读取配置
22

3-
tio-boot 框架的参数查找顺序是,支持所有参数 命令行参数-->环境变量-->配置文件
4-
使用命令行指定参数示例如下
3+
使用 EnvironmentUtils 工具类读取配置
54

6-
```shell
7-
java -jar paddle-ocr-server-1.0.1.jar --http-port 8080
8-
```
5+
```java
6+
import com.litongjava.tio.utils.environment.EnvironmentUtils;
7+
8+
String host = EnvironmentUtils.get("tdengine.host");
9+
int port = EnvironmentUtils.getInt("tdengine.port");
10+
```

docs/zh/03_配置/04.md

+1-29
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,4 @@
1-
# 配置
2-
3-
## 配置文件
4-
5-
tio-boot 默认支持加载两个配置文件
6-
7-
- src/main/resources/.env 环境变量配置文件,不能提交到 git 中
8-
- src/main/resources/app.properties 其他配置文件
9-
10-
## 常用配置
11-
12-
#### 设置静态文件目录
13-
14-
将 app.properties 中配置
15-
16-
```shell
17-
server.resources.static-locations = classpath:/pages
18-
```
19-
20-
#### 设置文件上传大小
21-
22-
```
23-
# 设置最大请求大小(包含所有文件)单位 字节,这里设置为1G
24-
http.multipart.max-request-size=73741824
25-
# 设置最大文件大小,单位字节,这里设置为1G
26-
http.multipart.max-file-size=73741824
27-
```
28-
29-
将静态文件放到 pages 目录下即可 DefaultHttpRequestHandler 的 processStatic 类会处理静态文件
1+
# 部分配置详解
302

313
## 多环境配置
324

docs/zh/03_配置/05.md

-9
This file was deleted.

docs/zh/03_配置/06.md

-160
This file was deleted.

0 commit comments

Comments
 (0)