Skip to content

Commit

Permalink
[rename]mock-server -> mock-server-local;
Browse files Browse the repository at this point in the history
  • Loading branch information
funkyLover committed Mar 3, 2019
1 parent 5ccb40a commit 65d45b9
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 19 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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.
Expand Down
12 changes: 6 additions & 6 deletions docs/zh/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

## 使用
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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配置
Expand Down
2 changes: 0 additions & 2 deletions lib/getMock.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,6 @@ function getMock(_path) {
return mock;
}

// getMock('/Users/funkyLover/Desktop/mock-server/example/simple');

module.exports = {
getMockPath,
isMockExist,
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -29,8 +29,8 @@
"mock api",
"mock server"
],
"engines" : {
"node" : ">=8"
"engines": {
"node": ">=8"
},
"author": "[email protected]",
"dependencies": {
Expand Down

0 comments on commit 65d45b9

Please sign in to comment.