Skip to content

Commit

Permalink
Rename --httpPort flag to --listen
Browse files Browse the repository at this point in the history
  • Loading branch information
sosedoff committed Oct 26, 2014
1 parent ba96c29 commit 7522877
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ Usage:
pgweb [OPTIONS]
Application Options:
-v Print version
-d Enable debugging mode (false)
--url= Database connection string
--host= Server hostname or IP (localhost)
--port= Server port (5432)
--user= Database user (postgres)
--db= Database name (postgres)
--ssl= SSL option (disable)
--httpPort= HTTP server listen port (8080)
-v Print version
-d Enable debugging mode (false)
--url= Database connection string
--host= Server hostname or IP (localhost)
--port= Server port (5432)
--user= Database user (postgres)
--db= Database name (postgres)
--ssl= SSL option (disable)
--listen= HTTP server listen port (8080)
```

## Compile from source
Expand Down
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var options struct {
User string `long:"user" description:"Database user" default:"postgres"`
DbName string `long:"db" description:"Database name" default:"postgres"`
Ssl string `long:"ssl" description:"SSL option" default:"disable"`
HttpPort string `long:"httpPort" description:"HTTP server listen port" default:"8080"`
HttpPort uint `long:"listen" description:"HTTP server listen port" default:"8080"`
}

var dbClient *Client
Expand Down Expand Up @@ -99,7 +99,7 @@ func startServer() {
router.GET("/static/:type/:name", API_ServeAsset)

fmt.Println("Starting server...")
go router.Run(":" + options.HttpPort)
go router.Run(fmt.Sprintf(":%v", options.HttpPort))
}

func handleSignals() {
Expand All @@ -109,7 +109,7 @@ func handleSignals() {
}

func openPage() {
url := "http://localhost:" + options.HttpPort
url := fmt.Sprintf("http://localhost:%v", options.HttpPort)
fmt.Println("To view database open", url, "in browser")

_, err := exec.Command("which", "open").Output()
Expand Down

0 comments on commit 7522877

Please sign in to comment.