Skip to main content

serve swagger api docs locally fast

Project description

provides a simple mechanism to locally serve your swagger.io spec files

Installation

pip install serve-swagger

Useage

you can pass in a local file

serve-swagger my-spec.yaml

and now you can visit it at http://localhost:5000

if you want to share your site on your local network you will need to specify the host

serve-swagger --host=0.0.0.0 c:\users\joran\demo\my_spec.yaml

now anyone can go to your network ip at http://10.10.X.Y:5000 and view your API docs

you can also specify the portnumber

serve-swagger -p 8080 api-spec.json

this would expose the server on port 8080 (http://localhost:8080)

usage: serve-swagger [-h] [-p [PORT]] [-s [HOST]] [-v] [swagger_spec_file]

positional arguments:
  swagger_spec_file     a local swagger spec file, or a url that serves a
                        swagger spec file

optional arguments:
  -h, --help            show this help message and exit
  -p [PORT], --port [PORT]
                        the port to serve on
  -s [HOST], --host [HOST]
                        the host interface to serve on
  -v, --debug           run flask in debug mode

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

serve-swagger-1.3.tar.gz (3.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page