Move starting #server function
This commit is contained in:
parent
69497c77e4
commit
17c8b0fa88
9
main.go
9
main.go
|
@ -1,8 +1,6 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
|
@ -37,10 +35,5 @@ func main() {
|
|||
HandleShutdown()
|
||||
LoadState()
|
||||
go KeepStatePersisted()
|
||||
|
||||
port := fmt.Sprintf(":%d", Config.Port)
|
||||
err := http.ListenAndServe(port, nil)
|
||||
if err != nil {
|
||||
Error(err, "Error starting server on port %d", Config.Port)
|
||||
}
|
||||
StartServer()
|
||||
}
|
||||
|
|
|
@ -8,6 +8,14 @@ import (
|
|||
"strings"
|
||||
)
|
||||
|
||||
func StartServer() {
|
||||
port := fmt.Sprintf(":%d", Config.Port)
|
||||
err := http.ListenAndServe(port, nil)
|
||||
if err != nil {
|
||||
Error(err, "Error starting server on port %d", Config.Port)
|
||||
}
|
||||
}
|
||||
|
||||
func StatusHandler(w http.ResponseWriter, r *http.Request) {
|
||||
info := make(map[string]map[string]uint)
|
||||
|
||||
|
|
Loading…
Reference in New Issue