Closed shyandsy closed 1 year ago
Hi, please check the following example:
package main
import (
"log"
"net/http"
swgui "github.com/swaggest/swgui/v5"
)
func main() {
urlToSchema := "/sso.json"
filePathToSchema := "./sso.json"
swh := swgui.NewHandler("Foo", urlToSchema, "/")
hh := http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
if r.URL.Path == urlToSchema {
http.ServeFile(rw, r, filePathToSchema)
return
}
swh.ServeHTTP(rw, r)
})
log.Println("Starting Swagger UI server at http://localhost:8082/")
_ = http.ListenAndServe("localhost:8082", hh)
}
the sample code like this
it doesnt work