node-red / node-red-node-swagger

A set of tools for generating Swagger api documentation based on the HTTP nodes deployed in a flow
Apache License 2.0
62 stars 47 forks source link

Added Swagger-UI tab to editor. #11

Closed codymwalker closed 9 years ago

codymwalker commented 9 years ago

Incorporates Swagger-UI into the editor, creating a new tab where the user can view and test the swagger doc that is being dynamically generated by the plugin.

For now, the user will have to manually refresh the swagger-ui to get the newly generated swagger doc after making changes and deploying. This will be changed once there is an api to tap into node-red's events.

codymwalker commented 9 years ago

It doesn't appear that you can get out of the directory being served. Regardless of what is entered, it seems to handle it before passing it off to the path module. So http://localhost:1880/swagger-ui/reqs/../../index.js translates to http://localhost:1880/index.js which produces a 404 error. The only place that you can go up one level is if you pass a single '/..' after the /reqs/ path, which will take you up to http://localhost:1880/swagger-ui/, which we're serving up anyway.

knolleary commented 9 years ago

I had a feeling that express did that for us, but could remember for certain. Good to have checked it though, thanks.

codymwalker commented 9 years ago

That was my thought. I figured it wasn't going to be there too terribly long.