Skip to content

Commit d73f4b4

Browse files
committed
Include some documentation about how to use the --add-server flag
1 parent 8104239 commit d73f4b4

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ A simple, quick, cross-platform API mock server that returns examples specified
1515
- Server validation (enabled with `--validate-server`)
1616
- Validates scheme, hostname/port, and base path
1717
- Supports `localhost` out of the box
18+
- Use the `--add-server` flag, in conjunction with `--validate-server`, to dynamically include more servers in the validation logic
1819
- Request parameter & body validation (enabled with `--validate-request`)
1920
- Configuration via:
2021
- Files (`/etc/apisprout/config.json|yaml`)
@@ -30,6 +31,9 @@ apisprout my-api.yaml
3031
# Validate server name and use base path
3132
apisprout --validate-server my-api.yaml
3233

34+
# Dynamically Include a new server / path in the validation
35+
apisprout --add-server http://localhost:8080/mock --validate-server my-api.yaml
36+
3337
# Load from a URL
3438
apisprout https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/api-with-examples.yaml
3539
```
@@ -60,6 +64,16 @@ Alternatively, you can use `go get`:
6064
go get github.com/danielgtaylor/apisprout
6165
```
6266

67+
## Extra Features
68+
69+
### Remote Reload
70+
71+
If your API spec is loaded from a remote URL, you can live-reload it by hitting the `/__reload` endpoint.
72+
73+
### Health Check
74+
75+
A simple endpoint which returns status code `200` is available at `/__health`. This endpoint successfully returns `200` even if `--validate-server` is turned on, and the endpoint is being accessed from a non-validated host.
76+
6377
## Contributing
6478

6579
Contributions are very welcome. Please open a tracking issue or pull request and we can work to get things merged in.

0 commit comments

Comments
 (0)