Skip to content

Commit

Permalink
doc: Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Oct 3, 2021
1 parent d5520d1 commit baf2adb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
7 changes: 4 additions & 3 deletions README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ module.exports = proxy;

- [`proxy`](https://www.npmjs.com/package/path-to-regexp) => `{}` Proxy settings, Turn a path string such as `/user/:name` into a regular expression.
- [`pathRewrite`](https://github.com/jaywcjlove/mocker-api/issues/62) => `{}` rewrite target's url path. Object-keys will be used as RegExp to match paths. [#62](https://github.com/jaywcjlove/mocker-api/issues/62)
- `withFullUrlPath=false` => `Boolean` the proxy regular expression support full url path. if the proxy regular expression like `/test?a=1&b=1` can be matched. [#25](https://github.com/jaywcjlove/mocker-api/issues/25)
- `priority` => `proxy` priority `proxy` or `mocker` [#151](https://github.com/jaywcjlove/mocker-api/issues/151)
- `changeHost` => `Boolean` Setting req headers host.
- `httpProxy` => `{}` Set the [listen event](https://github.com/nodejitsu/node-http-proxy#listening-for-proxy-events) and [configuration](https://github.com/nodejitsu/node-http-proxy#options) of [http-proxy](https://github.com/nodejitsu/node-http-proxy)
Expand Down Expand Up @@ -262,7 +263,7 @@ Or you can put it the `package.json` config as a current project dependency.

### [Express](https://github.com/expressjs/express) 中使用

[Express example](example/express)
[Express example](https://github.com/jaywcjlove/mocker-api/tree/master/example/express)

>⚠️ Not dependent on [webpack](https://github.com/webpack/webpack) and [webpack-dev-server](https://github.com/webpack/webpack-dev-server).
Expand Down Expand Up @@ -297,7 +298,7 @@ app.listen(8080);

### [Webpack](https://github.com/webpack/webpack) 中使用

[webpack example](example/webpack)
[webpack example](https://github.com/jaywcjlove/mocker-api/tree/master/example/webpack)

To use api mocker on your [Webpack](https://github.com/webpack/webpack) projects, simply add a setup options to your [webpack-dev-server](https://github.com/webpack/webpack-dev-server) options:

Expand Down Expand Up @@ -382,7 +383,7 @@ Mock API proxying made simple.

### 在 create-react-app 中使用

[create-react-app example](example/create-react-app)
[create-react-app example](https://github.com/jaywcjlove/mocker-api/tree/master/example/create-react-app)

创建 [`src/setupProxy.js`](https://github.com/jaywcjlove/mocker-api/blob/64a093685b05c70ab0ddcf3fd5dbede7871efa8a/example/create-react-app/src/setupProxy.js#L1-L11) 并放置以下内容:

Expand Down
10 changes: 5 additions & 5 deletions packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,9 @@ Or you can put it the `package.json` config as a current project dependency.
}
```

### Using With Express
### Using With [Express](https://github.com/expressjs/express)

[Express example](example/express)
[Express example](https://github.com/jaywcjlove/mocker-api/tree/master/example/express)

To use api mocker on your [express](https://github.com/expressjs/express) projects.

Expand Down Expand Up @@ -304,9 +304,9 @@ const app = express();
app.listen(8080);
```

### Using With Webpack
### Using With [Webpack](https://github.com/webpack/webpack)

[webpack example](example/webpack)
[webpack example](https://github.com/jaywcjlove/mocker-api/tree/master/example/webpack)

To use api mocker on your [Webpack](https://github.com/webpack/webpack) projects, simply add a setup options to your [webpack-dev-server](https://github.com/webpack/webpack-dev-server) options:

Expand Down Expand Up @@ -391,7 +391,7 @@ Mock API proxying made simple.

### Using With create-react-app

[create-react-app example](example/create-react-app)
[create-react-app example](https://github.com/jaywcjlove/mocker-api/tree/master/example/create-react-app)

To use api mocker on your [create-react-app](https://github.com/facebook/create-react-app/blob/3f699fd08044de9ab0ce1991a66b376d3e1956a8/docusaurus/docs/proxying-api-requests-in-development.md) projects. create [`src/setupProxy.js`](https://github.com/jaywcjlove/mocker-api/blob/64a093685b05c70ab0ddcf3fd5dbede7871efa8a/example/create-react-app/src/setupProxy.js#L1-L11) and place the following contents in it:

Expand Down

0 comments on commit baf2adb

Please sign in to comment.