feat: 新增web配置中心
This commit is contained in:
@@ -95,7 +95,21 @@ npm run typecheck
|
||||
| 方法 | 路径 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| `GET` | `http://localhost:<proxyPort>/__config` | 查看当前路由与配置 |
|
||||
| `POST` | `http://localhost:<proxyPort>/__config` | 保存 `config.json`(包含 `routes` 与 `config`) |
|
||||
| `POST` | `http://localhost:<proxyPort>/__reload-config` | 手动重新加载 `config.json` |
|
||||
| `POST` | `http://localhost:<proxyPort>/__routes` | 动态新增单个路由与 mock 文件 |
|
||||
| `GET` | `http://localhost:<proxyPort>/__admin` | 配置管理页面(Element UI) |
|
||||
|
||||
#### `POST /__routes` 请求示例
|
||||
|
||||
```json
|
||||
{
|
||||
"route": "/api/new/mock",
|
||||
"filePath": "mock/new-api.json",
|
||||
"fileContent": "{\"code\":0,\"message\":\"ok\"}",
|
||||
"overwrite": false
|
||||
}
|
||||
```
|
||||
|
||||
### TypeScript 与编译说明
|
||||
|
||||
|
||||
Reference in New Issue
Block a user