about summary refs log tree commit diff
path: root/src/http.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/http.go')
-rw-r--r--src/http.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/http.go b/src/http.go
index 91d1c87..d1e3507 100644
--- a/src/http.go
+++ b/src/http.go
@@ -21,7 +21,7 @@ func registerHTTPFlags() {
 	port = flag.Int("port", 8080, "The port for HTTP")
 }
 
-func runHTTPServer() (error) {
+func setupHTTPServer() (http.Server) {
 	r := mux.NewRouter()
 
 	r.HandleFunc("/", indexHandler)
@@ -37,8 +37,10 @@ func runHTTPServer() (error) {
 	r.HandleFunc("/api/stopContainer", stopContainerHandler).Methods("POST")
 	r.HandleFunc("/api/getAccess", getAccessHandler).Methods("GET")
 
-	address := fmt.Sprintf("0.0.0.0:%d", *port)
-	return http.ListenAndServe(address, r)
+	return http.Server{
+		Addr: fmt.Sprintf("0.0.0.0:%d", *port),
+		Handler: r,
+	}
 }
 
 // Host the index file