From 65d45b9900e8d6ecc0149db1a9880d83dbb176ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E9=BE=99=E8=BE=89?= <540886643@qq.com> Date: Sun, 3 Mar 2019 09:59:35 +0800 Subject: [PATCH] [rename]mock-server -> mock-server-local; --- README.md | 12 ++++++------ docs/zh/README.md | 12 ++++++------ lib/getMock.js | 2 -- package-lock.json | 4 ++-- package.json | 6 +++--- 5 files changed, 17 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 966022b..9f16799 100644 --- a/README.md +++ b/README.md @@ -6,18 +6,18 @@ A widget for mocking back-end api when development, it will generate a mock api ## Installation -mock-server requires node v8.x.x or higher. +mock-server-local requires node v8.x.x or higher. Global install ```bash -npm install -g mock-server +npm install -g mock-server-local ``` Local install within project ```bash -npm install mock-server --save-dev +npm install mock-server-local --save-dev ``` ## Usage @@ -137,7 +137,7 @@ api.mock.com 127.0.0.1:8080 # Local server for server front-end resource during ## Mock api -If you want the mock api with full url to be `api.mock.com/api-bin/api1`, the directory structure should as follows (the full configuration can be found in [docs/mock](https://github.com/funkyLover/mock-server/tree/dev/docs/mock)) +If you want the mock api with full url to be `api.mock.com/api-bin/api1`, the directory structure should as follows (the full configuration can be found in [docs/mock](./docs/mock)) ``` ${mock dir} @@ -361,12 +361,12 @@ If the proxy ip is not configured, it will return 404 directly. ## Recommend -Recommend to install mock-server as a devDependency within project. +Recommend to install mock-server-local as a devDependency within project. ```bash cd xxx_project -npm install mock-server --save-dev +npm install mock-server-local --save-dev ``` Create a mock directory in the project directory to place the mock api configuration. diff --git a/docs/zh/README.md b/docs/zh/README.md index d1613bf..bedcbd2 100644 --- a/docs/zh/README.md +++ b/docs/zh/README.md @@ -4,18 +4,18 @@ ## 安装 -mock-server运行环境需node v8.x及以上版本支持 +mock-server-local运行环境需node v8.x及以上版本支持 全局安装 ```bash -npm install -g mock-server +npm install -g mock-server-local ``` 或作为项目开发依赖安装 ```bash -npm install mock-server --save-dev +npm install mock-server-local --save-dev ``` ## 使用 @@ -135,7 +135,7 @@ api.mock.com 127.0.0.1:8080 # 开发时用于server前端资源启动的本地 ## mock api -如果你想mock的api完整url为`api.mock.com/api-bin/api1`, 目录结构应该如下所示(文档中出现的完整配置, 可见[docs/mock](https://github.com/funkyLover/mock-server/tree/dev/docs/mock)) +如果你想mock的api完整url为`api.mock.com/api-bin/api1`, 目录结构应该如下所示(文档中出现的完整配置, 可见[docs/mock](../mock)) ``` ${mock dir} @@ -358,12 +358,12 @@ module.exports = data; ## 推荐用法 -建议将mock-server作为开发依赖安装到具体项目中去 +建议将mock-server-local作为开发依赖安装到具体项目中去 ```bash cd xxx_project -npm install mock-server --save-dev +npm install mock-server-local --save-dev ``` 在项目目录下新建mock目录用于存放mock api配置 diff --git a/lib/getMock.js b/lib/getMock.js index 7982b67..5975644 100644 --- a/lib/getMock.js +++ b/lib/getMock.js @@ -195,8 +195,6 @@ function getMock(_path) { return mock; } -// getMock('/Users/funkyLover/Desktop/mock-server/example/simple'); - module.exports = { getMockPath, isMockExist, diff --git a/package-lock.json b/package-lock.json index 83cb338..53be721 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { - "name": "mock-server", - "version": "0.9.2", + "name": "mock-server-local", + "version": "1.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index feab318..a0d8422 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "mock-server", + "name": "mock-server-local", "version": "1.0.0", "description": "Mock your apis with a node server", "main": "index.js", @@ -29,8 +29,8 @@ "mock api", "mock server" ], - "engines" : { - "node" : ">=8" + "engines": { + "node": ">=8" }, "author": "ahui-lin@qq.com", "dependencies": {