Skip to content

一个简便的查看多个swagger json的swagger-ui项目

License

Notifications You must be signed in to change notification settings

soonio/swagger-ui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

swagger-ui

Golang一键构建

CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -trimpath -o swagger-linux-amd64 main.go
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "-s -w" -trimpath -o swagger-windows-amd64.exe main.go
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w" -trimpath -o swagger-darwin-amd64 main.go
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags "-s -w" -trimpath -o swagger-darwin-arm64 main.go

使用

./swagger-darwin-arm64 -secret 123456 -port 8900

快速上传本地文件到目标服务

curl -F "file=@docs/example.test.json" \
    -F "filename=ttt.json" \
    -F "secret=password" \
    http://localhost:8900/upload

获取文档文件列表

curl http://localhost:8900/list

刷新文档

curl http://localhost:8900/refresh

简单守护启动

nohup ./swagger -secret password >> server.log 2>&1 &