summary refs log tree commit diff stats
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/main.go b/main.go
index 4b62f27..4508edf 100644
--- a/main.go
+++ b/main.go
@@ -66,7 +66,7 @@ func main() {
 	// handlers.CompressHandler gzips all responses.
 	// Write/Read timeouts are self explanatory.
 	server := &http.Server{
-		Handler:      handlers.CompressHandler(index),
+		Handler:      handlers.CompressHandler(ipMiddleware(index)),
 		Addr:         portnum,
 		WriteTimeout: 15 * time.Second,
 		ReadTimeout:  15 * time.Second,
@@ -77,6 +77,12 @@ func main() {
 	if err != nil {
 		log.Printf("%v\n", err)
 	}
+	defer func() {
+		err := server.Close()
+		if err != nil {
+			log.Printf("%v\n", err)
+		}
+	}()
 
 	closelog <- true
 }