You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-6Lines changed: 12 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,14 +8,16 @@ Let's assume we have the following service in the configuration file and the use
8
8
```yaml
9
9
services:
10
10
- endpoint: /hogwarts
11
-
url: http://localhost:8000/hogwarts/
11
+
url: http://host.docker.internal:8000/hogwarts/
12
+
swagger_url: http://localhost:8000/hogwarts/
12
13
```
13
14
14
-
User can request the OAS docs for the `hogwarts` microservice by going to <https://oasbinder.example.com/hogwarts> in the browser.
15
-
16
-
`oasbinder`will request the OAS specification from the service at <http://localhost:8000/hogwarts/openapi.json> and return it to the user for viewing and interacting in the browser.
17
-
The location of the OAS specs is configurable.
18
-
Multiple services can be configured and user can then select them from a drop-down list.
15
+
* User can request the OAS docs for the microservice by going to `proxyAddress + endpoint` in the browser (in this example: <https://oasbinder.example.com/hogwarts>).
16
+
* `oasbinder` will request the OAS specification from the service at <http://host.docker.internal:8000/hogwarts/openapi.json> and return it to the user for viewing and interacting in the browser.
17
+
* When user interacts with the API in the browser, the requests to the API will be directed to <http://localhost:8000/hogwarts/>.
18
+
* In many cases `url` can be equal to `swagger_url`. An example of a situation where they can be different is e.g. a docker-compose setup where both `oasbinder` and the service can communicate via internal Docker network. `oasbinder` can request the OAS specs using the internal Docker hostname, and the user will send the requests using SwaggerUI to the service from the outside of the cluster via `swagger_url`.
19
+
* The location of the OAS specs (`openapi.json` by default) is configurable. Multiple services can be configured and user can then select them from a drop-down list.
20
+
* The drop-down list will contain the name and decription of the service retrieved from the OAS specs fields: `.info.title` and `.info.summary`.
19
21
20
22
All the services will need to have CORS configured in a way which allows requests from <https://oasbinder.example.com>.
21
23
@@ -52,15 +54,19 @@ Example contents of configuration file:
52
54
```yaml
53
55
# The address at which the user will access `oasbinder`.
54
56
proxyAddress: http://localhost:8080
57
+
# The address on which `oasbinder` will listen.
58
+
listenAddress: 0.0.0.0
55
59
# The port on which `oasbinder` will listen. This can be used in case `oasbinder` is run e.g. in a k8s cluster
56
60
# and the user is accessing it from the outside of the cluster.
57
61
listenPort: 8080
58
62
59
63
services:
60
64
- endpoint: /gringotts
61
65
url: http://localhost:8000/gringotts/
66
+
swagger_url: http://localhost:8000/gringotts/
62
67
- endpoint: /hogwarts
63
68
url: http://localhost:8000/hogwarts/
69
+
swagger_url: http://localhost:8000/hogwarts/
64
70
65
71
# Additional headers to pass to microservices, e.g. for authentication.
0 commit comments