Skip to content

phwoolcon/swagger-editor-helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swagger Editor Helper

Hack Swagger Editor to Provide View-only Mode.

I don't have enough time and nodejs working experience to contribute to Swagger Editor itself, so I just hack it by override the response in nginx.

The community looks not that easy:

Usage

  1. Install Swagger Editor by docker:
    docker pull swaggerapi/swagger-editor
    docker run -d -p 9010:8080 swaggerapi/swagger-editor
    This will run swagger-editor on port 9010
  2. Copy nginx files to your nginx config directory:
    cp -r nginx/* /etc/nginx
  3. Change server_name and root
    vim /etc/nginx/sites-enabled/swagger.conf
    ATTENTION: use public dir as root
  4. Reload nginx
    nginx -t && nginx -s reload

HTTPS

If you want to access swagger via https, please:

  1. Prepare SSL certificate;
  2. Use swagger.https.conf:
    ln -snf ../sites-available/swagger.https.conf /etc/nginx/sites-enabled/swagger.conf
  3. Change ssl_certificate and ssl_certificate_key to use real certificate;
  4. Generate a dhparam file:
    sudo openssl dhparam -out /etc/nginx/ssl/dhparam.pem 4096
  5. Then reload nginx:
    nginx -t && nginx -s reload

About

Hack Swagger Editor to Provide View-only Mode

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published