mirror of
https://github.com/sosedoff/pgweb.git
synced 2024-12-15 03:36:33 +03:00
Disable Gin default debug mode, add -d flag to control it
This commit is contained in:
parent
e38aedd176
commit
e78499551e
5
main.go
5
main.go
@ -9,6 +9,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var options struct {
|
var options struct {
|
||||||
|
Debug bool `short:"d" description:"Enable debugging mode" default:"false"`
|
||||||
Url string `long:"url" description:"Database connection string"`
|
Url string `long:"url" description:"Database connection string"`
|
||||||
Host string `long:"host" description:"Server hostname or IP" default:"localhost"`
|
Host string `long:"host" description:"Server hostname or IP" default:"localhost"`
|
||||||
Port int `long:"port" description:"Server port" default:"5432"`
|
Port int `long:"port" description:"Server port" default:"5432"`
|
||||||
@ -75,6 +76,10 @@ func main() {
|
|||||||
|
|
||||||
defer dbClient.db.Close()
|
defer dbClient.db.Close()
|
||||||
|
|
||||||
|
if !options.Debug {
|
||||||
|
gin.SetMode("release")
|
||||||
|
}
|
||||||
|
|
||||||
router := gin.Default()
|
router := gin.Default()
|
||||||
|
|
||||||
router.GET("/", API_Home)
|
router.GET("/", API_Home)
|
||||||
|
Loading…
Reference in New Issue
Block a user