chore: 修改默认端口为16016
This commit is contained in:
@@ -44,7 +44,7 @@ npm start
|
||||
node server.js
|
||||
```
|
||||
|
||||
服务默认运行在 `16023` 端口,可通过环境变量修改:
|
||||
服务默认运行在 `16016` 端口,可通过环境变量修改:
|
||||
|
||||
```bash
|
||||
PORT=8080 node server.js
|
||||
@@ -52,14 +52,14 @@ PORT=8080 node server.js
|
||||
|
||||
### Web UI
|
||||
|
||||
浏览器访问 `http://localhost:16023` 即可使用可视化界面。
|
||||
浏览器访问 `http://localhost:16016` 即可使用可视化界面。
|
||||
|
||||
### API 调用
|
||||
|
||||
#### POST 方式(推荐)
|
||||
|
||||
```bash
|
||||
curl -X POST http://localhost:16023/api/chart \
|
||||
curl -X POST http://localhost:16016/api/chart \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"data": "产品, Q1, Q2, Q3, Q4\n手机, 1200, 1800, 2100, 2500\n平板, 800, 950, 1100, 1300",
|
||||
@@ -74,7 +74,7 @@ curl -X POST http://localhost:16023/api/chart \
|
||||
#### GET 方式
|
||||
|
||||
```bash
|
||||
curl "http://localhost:16023/api/chart?data=产品,Q1,Q2\n手机,100,200\n平板,150,250&type=bar&title=测试" -o chart.png
|
||||
curl "http://localhost:16016/api/chart?data=产品,Q1,Q2\n手机,100,200\n平板,150,250&type=bar&title=测试" -o chart.png
|
||||
```
|
||||
|
||||
#### Python 调用示例
|
||||
@@ -82,7 +82,7 @@ curl "http://localhost:16023/api/chart?data=产品,Q1,Q2\n手机,100,200\n平板
|
||||
```python
|
||||
import requests
|
||||
|
||||
resp = requests.post('http://localhost:16023/api/chart', json={
|
||||
resp = requests.post('http://localhost:16016/api/chart', json={
|
||||
"data": "月份, 营收, 利润\n1月, 500, 80\n2月, 680, 120\n3月, 820, 160",
|
||||
"chartType": "line",
|
||||
"title": "增长趋势",
|
||||
|
||||
Reference in New Issue
Block a user