Skip to content

Commit

Permalink
Remove deprecated and vulnerable Swagger UI v2 (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
vearutop authored Dec 17, 2020
1 parent 76ea919 commit dbace59
Show file tree
Hide file tree
Showing 52 changed files with 5 additions and 28,933 deletions.
16 changes: 5 additions & 11 deletions swgui-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,27 @@ import (
"fmt"
"net/http"

"github.com/swaggest/swgui/v2"
"github.com/swaggest/swgui/v3"
)

var (
host string
port uint
title string
version = "v3"
host string
port uint
title string
)

func init() {
flag.StringVar(&host, "host", "", "Host")
flag.UintVar(&port, "port", 8080, "Port")
flag.StringVar(&title, "title", "API Document", "Page title")
flag.StringVar(&version, "version", "v3", "Swagger UI version (v2/v3)")

flag.Parse()
}

func main() {
var h http.Handler
if version != "v3" {
h = v2.NewHandler(title, "/swagger.json", "/")
} else {
h = v3.NewHandler(title, "/swagger.json", "/")
}
h = v3.NewHandler(title, "/swagger.json", "/")

http.Handle("/", h)
fmt.Printf("Listening at %s:%d\n", host, port)
http.ListenAndServe(fmt.Sprintf("%s:%d", host, port), nil)
Expand Down
20 changes: 0 additions & 20 deletions v2/gen/gen.go

This file was deleted.

61 changes: 0 additions & 61 deletions v2/handler.go

This file was deleted.

165 changes: 0 additions & 165 deletions v2/index.tpl.go

This file was deleted.

609 changes: 0 additions & 609 deletions v2/static.go

This file was deleted.

Loading

0 comments on commit dbace59

Please sign in to comment.