summary refs log tree commit diff stats
path: root/main.go
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2019-05-11 02:40:49 -0400
committerBen Morrison <ben@gbmor.dev>2019-05-11 02:40:49 -0400
commitfb63b07e950004068bc883818f84c9ddbbb9be02 (patch)
treefb9e4af16db8a0b2370f6ba5ccf66fb9070de1bd /main.go
parentc8314846252655c7d968194f6e5d74dfc27af7da (diff)
downloadgetwtxt-fb63b07e950004068bc883818f84c9ddbbb9be02.tar.gz
gzipped responses
Diffstat (limited to 'main.go')
-rw-r--r--main.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/main.go b/main.go
index 83344d0..374b94f 100644
--- a/main.go
+++ b/main.go
@@ -3,12 +3,16 @@ package main
 import (
 	"log"
 	"net/http"
+
+	"github.com/gorilla/handlers"
 )
 
 func main() {
 	log.Printf("getwtxt v0.1\n")
 
-	http.HandleFunc("/api/", apiHandler)
+	serv := http.NewServeMux()
+
+	serv.HandleFunc("/api/", apiHandler)
 
-	log.Fatalln(http.ListenAndServe(":8080", nil))
+	log.Fatalln(http.ListenAndServe(":8080", handlers.CompressHandler(serv)))
 }