mock-service-cli 4.2.0 → 4.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  [![release status](https://github.com/chandq/mock-service-cli/actions/workflows/release.yml/badge.svg)](https://github.com/chandq/mock-service-cli/actions/workflows/release.yml)
2
2
  [![Coverage Status](https://coveralls.io/repos/github/chandq/mock-service-cli/badge.svg?branch=master)](https://coveralls.io/github/chandq/mock-service-cli?branch=master)
3
3
  [![mock-service-cli](https://img.shields.io/github/package-json/v/chandq/mock-service-cli?style=flat-square)](https://www.npmjs.com/package/mock-service-cli)
4
- [![node](https://img.shields.io/badge/language-node-orange.svg)](https://nodejs.org/download/release/v12.0.0/)
5
4
  [![license:MIT](https://img.shields.io/npm/l/vue.svg?sanitize=true)](https://github.com/chandq/mock-service-cli/blob/master/LICENSE.md)
6
5
 
7
6
  # 🦅 mock-service-cli
@@ -74,6 +73,8 @@ npx mock-service-cli [options] [path]
74
73
  | `-R` 或 `--static-server` | 启用静态服务器,指定静态资源目录 | - |
75
74
  | `-w` 或 `--open` | 自动打开 API 概览页、文件浏览器页 | false |
76
75
  | `-e` 或 `--explorer` | 启用文件浏览器服务器,指定要浏览的目录 | ./ |
76
+ | `--edit` | 启用文件浏览器的新建、重命名和删除操作 | false |
77
+ | `--host` | 将全部 Web 服务暴露到所有 IPv4 网卡 | false |
77
78
 
78
79
  ## 📖 使用示例
79
80
 
@@ -131,8 +132,18 @@ mock-service-cli -e /path/to/directory
131
132
 
132
133
  # 指定端口
133
134
  mock-service-cli -e ./ -p 9090
135
+
136
+ # 启用文件编辑操作
137
+ mock-service-cli -e ./ --edit
138
+
139
+ # 暴露到局域网(编辑操作仍需额外传入 --edit)
140
+ mock-service-cli -e ./ --host
134
141
  ```
135
142
 
143
+ 默认情况下,Mock、SPA、Static 和 File Explorer 服务只监听 `127.0.0.1`。
144
+ `--host` 会使这些服务监听所有 IPv4 网卡,请仅在可信网络中使用。文件浏览器默认只读;
145
+ 必须在启动时传入 `--edit` 才能创建、重命名或删除文件。
146
+
136
147
  ## 📝 编写 Mock 文件
137
148
 
138
149
  Mock 文件支持 CommonJS 规范,不支持 ES Module。