simplify
This commit is contained in:
parent
99e29ec2d5
commit
6591ca67d3
12
main.go
12
main.go
@ -54,24 +54,20 @@ func main() {
|
||||
}
|
||||
defer dbPort.Close()
|
||||
|
||||
// if noweb is false, then start web service
|
||||
if !cfg.Board.NoWeb && cfg.API[0].Enabled {
|
||||
apiPort = http.NewGinAdapter(corePort, cfg)
|
||||
go apiPort.Run()
|
||||
}
|
||||
|
||||
color.Set(color.FgHiRed)
|
||||
fmt.Printf("Started on: %s\n", time.Now().Format(time.DateTime))
|
||||
color.Unset()
|
||||
|
||||
// if noweb is false and HTTP/REST API is enabled then start web service
|
||||
if !cfg.Board.NoWeb && cfg.API[0].Enabled {
|
||||
apiPort = http.NewGinAdapter(corePort, cfg)
|
||||
go apiPort.Run()
|
||||
|
||||
color.Set(color.FgHiGreen)
|
||||
fmt.Printf("TH7 API is live on http://localhost:%d/\n", cfg.API[0].Port)
|
||||
color.Unset()
|
||||
}
|
||||
|
||||
fmt.Println(cfg.API[0])
|
||||
|
||||
sig := <-kill
|
||||
log.Printf("Caught signal %v", sig)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user