> You can download Swagger UI code. That would be a huge overkill. All I need is a single endpoint in the existing swagger-go http server.
On Monday, February 5, 2018 at 9:09:47 PM UTC-8, Ramya wrote: > > Hi Ali, > > You can download Swagger UI code. > Update the path of your yaml file in index.html. > > Thanks & Regards, > Ramya > > On Tue, Feb 6, 2018 at 4:56 AM, Al Izi <[email protected] <javascript:> > > wrote: > >> We've got some json REST API implemented with *go-swagger*. Now we would >> like to add some simple web UI (several static html, js and css files) >> hosted by the same http server. The implementation is fairly simple. >> >> Swagger YAML: >> /ui/html/{path}: >> get: >> ... >> produces: >> - text/html >> >> >> /ui/js/{path}: >> get: >> ... >> produces: >> - application/javascript >> >> >> /ui/css/{path}: >> get: >> ... >> produces: >> - text/css >> >> and GO handler: >> >> api.GetHTML = operations.GetHTMLFunc( >> func(params operations.GetHTMLParams) middleware.Responder { >> bytes, _ := ioutil.ReadFile(params.Path) >> return operations.NewGetHTMLOK().WithPayload(string(bytes)) >> }) >> ... the same for JS and CSS ... >> >> >> Unfortunately this looks ugly as hell. Each content type needs its own >> path on the server. Is there a better way? Would it be possible to modify >> reply content type by the header? >> >> -- >> 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.
