Runs an api mock server, by parsing a swagger.yaml file
10K+
Runs an api mock server, by parsing a swagger.yaml file. You can edit the swagger.yaml, reload the browser and everything should be up-to-date.
The
-iis important for thectrl-ccommand to be send togrunt.
docker run -i \
-p 8000:8000 \
-t palo/swagger-api-mock
You need a folder where your swagger.yaml is placed.
It has to be named swagger.yaml.
docker run -i \
-p 8000:8000 \
-v /path/to/folder:/data \
-t palo/swagger-api-mock
If you need to specify a different name for YAML file you can mount a volume like the following:
docker run -i \
-p 8000:8000 \
-v /path/to/file.yaml:/data/swagger.yaml \
-t palo/swagger-api-mock
HTTP headers for Cross-Origin Resource Sharing (CORS) are automatically set to allow any kind of access. All preflight or normal requests will be automatically served with the following values:
| Header | Value |
|---|---|
Access-Control-Allow-Origin | If the HTTP request includes an Origin header, then this value is echoed back; otherwise value is a wildcard * |
Access-Control-Allow-Credentials | If the Access-Control-Allow-Origin is a wildcard * value is false; otherwise true. |
Access-Control-Allow-Methods | All HTTP methods are always sent. |
Access-Control-Allow-Headers | If the HTTP request includes an Access-Control-Request-Headers header, then this value is echoed back; otherwise it is not set. |
Please note that preflight requests (with OPTIONS method) will be always forced to HTTP code 200, even if not declared in YAML file.
Content type
Image
Digest
Size
263.9 MB
Last updated
over 9 years ago
docker pull palo/swagger-api-mock