Skip to content

Latest commit

 

History

History
40 lines (31 loc) · 970 Bytes

README.MD

File metadata and controls

40 lines (31 loc) · 970 Bytes

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 &