File tree Expand file tree Collapse file tree 2 files changed +23
-9
lines changed
Expand file tree Collapse file tree 2 files changed +23
-9
lines changed Original file line number Diff line number Diff line change @@ -29,23 +29,20 @@ supported.
2929## Installation
3030
3131To install the CLI globally:
32+
3233``` npm install -g openapi-cop ```
3334
34- To install the package locally (inside an existing NPM package) and run the proxy programatically:
35- ``` npm install openapi-cop ```
35+ To install the package locally (inside an existing NPM package) and run the proxy programatically:
3636
37- We also publish a Docker image [ lxlu/openapi-cop] ( https://hub.docker.com/r/lxlu/openapi-cop ) that you can use for your
38- convenience. This means you can also run openapi-cop with
39- something like
40- ``` docker run --rm -p 8888:8888 lxlu/openapi-cop ```
37+ ``` npm install openapi-cop ```
4138
4239## Usage
4340
4441There are three ways to run openapi-cop:
4542
46- 1 . Start it with the CLI.
47- 2 . Run it programatically inside Node.js.
48- 3 . Start a container based on the Docker image.
43+ 1 . Start it with the CLI ( [ 1 ] ( #cli-usage ) ) .
44+ 2 . Run it programatically inside Node.js ( [ 2 ] ( #module-usage ) ) .
45+ 3 . Start a container based on the Docker image ( [ 3 ] ( #docker-image-usage ) ) .
4946
5047### CLI Usage
5148
@@ -228,6 +225,16 @@ const server = await runProxy({
228225});
229226```
230227
228+ ### Docker Image Usage
229+
230+ We publish a Docker image [ lxlu/openapi-cop] ( https://hub.docker.com/r/lxlu/openapi-cop ) that you can use for your
231+ convenience. This means you can also run openapi-cop with
232+ something like
233+
234+ ``` docker run --rm -p 8888:8888 --env TARGET=https://some-host-name:1234 --env FILE=some-openapi-document.json lxlu/openapi-cop ```
235+
236+ Read more information about the usage [ here] ( ./docker/README.md ) .
237+
231238## FAQ
232239
233240<details >
Original file line number Diff line number Diff line change @@ -34,6 +34,13 @@ same [openapi-cop CLI flags](https://github.com/EXXETA/openapi-cop#cli-usage):
3434- ` VERBOSE ` : When set, activates verbose output.
3535- ` NODE_ENV ` (default: "production"): When set to "development", stack traces will also be logged.
3636
37+ ### Example
38+
39+ The following command will run the proxy against a provided target server, taking as a reference a given OpenAPI
40+ document, and expose port 8888 to the host system.
41+
42+ ``` docker run --rm -p 8888:8888 --env TARGET=https://some-host-name:1234 --env FILE=some-openapi-document.json lxlu/openapi-cop ```
43+
3744## License
3845
3946See https://github.com/EXXETA/openapi-cop/blob/master/LICENSE .
You can’t perform that action at this time.
0 commit comments