swagger-suite icon indicating copy to clipboard operation
swagger-suite copied to clipboard

Access URLs in server.js script?

Open SteveNewhouse opened this issue 10 years ago • 3 comments

Thanks for your work on swagger-suite... It has a lot of promise.

Is there a way to access the URLs for each service (UI, editor, docs) so that I can use the 'open' package to pop them open in a browser?

SteveNewhouse avatar Jul 30 '15 21:07 SteveNewhouse

Not sure what you mean by "URLs for each service". You should be able to access them at http://<host>:<port>/ui, http://<host>:<port>/editor, and http://<host>:<port>/docs.

JamesMessinger avatar Jul 31 '15 02:07 JamesMessinger

My question was really, how can I get the host & port values programmatically after launching swagger-suite so I can use the 'open' package to launch them in a browser automatically rather than having to type it in?

On Thu, Jul 30, 2015 at 10:59 PM, James Messinger [email protected] wrote:

Not sure what you mean by "URLs for each service". You should be able to access them at http://:/ui, http://:/editor, and http://:/docs.

— Reply to this email directly or view it on GitHub https://github.com/BigstickCarpet/swagger-suite/issues/7#issuecomment-126550539 .

SteveNewhouse avatar Jul 31 '15 03:07 SteveNewhouse

If you have a host & port number specified in your Swagger API, then Swagger Suite will use that. Or, if you don't want to put that in your API definition, then you can pass a port number to the start() method:

// Start Swagger Suite on port 8080
server.start(8080);

JamesMessinger avatar Jul 31 '15 11:07 JamesMessinger