Hi Tony- Not sure if that answers the question I had? I did get it running, but wasn't sure about my method.
I don't have much experience with docker, but if I were to run the docker image wouldn't I still be dealing with CORS when I submitted post requests (for testing) from the editor? I'd like to avoid this... Alan On Friday, September 30, 2016 at 5:55:04 PM UTC-7, tony tam wrote: > > The fastest way to do this is to use the public docker image. It’s just > one step to run it: > > https://hub.docker.com/r/swaggerapi/swagger-editor/ > > On Sep 30, 2016, at 5:48 PM, [email protected] <javascript:> wrote: > > 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 > > - Decided to access the file directly via > http://localhost:8000/static/swagger-editor/index.html > - At this point a handful of files were served, but received a 404 on > defaults.json and noticed that the Request URL was: > http://localhost:8000/static/swagger-editor/index.html/config/defaults.json > - Couldn't find where this was configured, so I just searched the > bundle.js file for defaults.json > - Saw: s=a+"config/defaults.json" and edited to be: s=" > http://localhost:8000/static/swagger-editor/config/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 > > > -- > You received this message because you are subscribed to the Google Groups > "Swagger" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] <javascript:>. > For more options, visit https://groups.google.com/d/optout. > > > -- You received this message because you are subscribed to the Google Groups "Swagger" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
