0
0
mirror of https://github.com/vx3r/wg-gen-web.git synced 2024-12-18 00:13:23 +00:00

issue #11 bug, introduced earlier 0aad10cb63

This commit is contained in:
vx3r 2020-02-20 11:08:47 +09:00
parent 27ac668c0b
commit fe2ee45032

10
main.go
View File

@ -41,6 +41,16 @@ func main() {
} }
} }


// check if server.json exists otherwise create it
if !util.FileExists(filepath.Join(os.Getenv("WG_CONF_DIR"), "server.json")) {
_, err = core.ReadServer()
if err != nil {
log.WithFields(log.Fields{
"err": err,
}).Fatal("server.json doesnt not exists and can not read it")
}
}

if os.Getenv("GIN_MODE") == "debug" { if os.Getenv("GIN_MODE") == "debug" {
// set gin release debug // set gin release debug
gin.SetMode(gin.DebugMode) gin.SetMode(gin.DebugMode)