forked from lazada/swgui
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from ngdinhtoan/master
- Update README doc. - Add missing flag.Parse() for swgui-server.
- Loading branch information
Showing
2 changed files
with
17 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,33 @@ | ||
# Swagger UI | ||
|
||
Package swgui (Swagger UI) provide a HTTP handler to serve Swagger UI. | ||
[![GoDoc](https://godoc.org/github.com/lazada/swgui?status.svg)](https://godoc.org/github.com/lazada/swgui) | ||
|
||
Package `swgui` (Swagger UI) provide a HTTP handler to serve Swagger UI. | ||
All assets are embedded in GO source code, so just build and run. | ||
|
||
## How to use | ||
|
||
```go | ||
package main | ||
package main | ||
|
||
import "http" | ||
import "github.com/lazada/swgui" | ||
import ( | ||
"http" | ||
|
||
func main() { | ||
http.Handle("/", swgui.NewHandler("Page title", "path/to/swagger.json", "/")) | ||
http.ListenAndServe(":8080", nil) | ||
} | ||
"github.com/lazada/swgui" | ||
) | ||
|
||
func main() { | ||
http.Handle("/", swgui.NewHandler("Page title", "path/to/swagger.json", "/")) | ||
http.ListenAndServe(":8080", nil) | ||
} | ||
``` | ||
|
||
## Run as standalone server | ||
|
||
Install swgui server | ||
Install `swgui-server` | ||
|
||
go get github.com/lazada/swgui/... | ||
|
||
Start server | ||
|
||
swgui-server -port 8080 | ||
|
||
## GoDoc | ||
|
||
[![GoDoc](https://godoc.org/github.com/lazada/swgui?status.svg)](https://godoc.org/github.com/lazada/swgui) | ||
|
||
godoc github.com/lazada/swgui/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters