Hi All- I was just introduced to swagger yesterday, and was trying to figure out how to host the swagger editor in my own domain to test out some post requests. I eventually got the swagger editor files to be served (using flask, testing locally), but only with some tinkering with the bundle.js file. (so not satisfied with that approach)
What I did:
- I downloaded the latest release (v2.10.3) from github- Dropped the swagger-editor folder into an existing web applications static folder
- Initially I tried a Flask route decorator to send_static_file ("swagger-editor/index.html"), but had some issues with a Request URL with *worker.js so I stopped tinkering with the Flask decorator
- Couldn't find where this was configured, so I just searched the bundle.js file for defaults.json
- Refreshed browser and swagger-editor was online!
I'm guessing that editing the bundle.js probably isn't the preferred/correct method, can someone advise me on how I could have resolved the issue with defaults.json?
You might be wondering why I didn't pull the project and build- I tried pulling the project down to one of our linux servers, but had issues with the build (something about ERROR in Use of const in strict mode (?possibly due to old node package, but didn't want to investigate that at the moment)
Directory structure:
webapp
-src
-static
|-swagger-editor
||-config
||-dist
||-images
||-...
||-index.html
-web.py