issue #11 bug, introduced earlier 0aad10cb63

This commit is contained in:
vx3r 2020-02-20 11:08:47 +09:00
parent 27ac668c0b
commit fe2ee45032
1 changed files with 10 additions and 0 deletions

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" {
// set gin release debug
gin.SetMode(gin.DebugMode)