Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/soonio/swagger-ui
一个简便的查看多个swagger json的swagger-ui项目
https://github.com/soonio/swagger-ui
api-docs go swagger swagger-ui
Last synced: 24 days ago
JSON representation
一个简便的查看多个swagger json的swagger-ui项目
- Host: GitHub
- URL: https://github.com/soonio/swagger-ui
- Owner: soonio
- License: mit
- Created: 2021-05-27T03:09:27.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-08-24T10:16:49.000Z (4 months ago)
- Last Synced: 2024-08-24T11:31:17.296Z (4 months ago)
- Topics: api-docs, go, swagger, swagger-ui
- Language: Go
- Homepage:
- Size: 12.4 MB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- License: License
Awesome Lists containing this project
README
# swagger-ui
## Golang一键构建
```bash
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
```## 使用
```bash
./swagger-darwin-arm64 -secret 123456 -port 8900
```### 快速上传本地文件到目标服务
```bash
curl -F "file=@docs/example.test.json" \
-F "filename=ttt.json" \
-F "secret=password" \
http://localhost:8900/upload
```### 获取文档文件列表
```bash
curl http://localhost:8900/list
```### 刷新文档
```bash
curl http://localhost:8900/refresh
```### 简单守护启动
```bash
nohup ./swagger -secret password >> server.log 2>&1 &
```