Move starting #server function

This commit is contained in:
2014-07-29 13:56:46 +07:00
parent 69497c77e4
commit 17c8b0fa88
2 changed files with 9 additions and 8 deletions
+1 -8
View File
@@ -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
View File
@@ -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)