From b46172b255ae7289f5843a1670c9ff2d19ba90f2 Mon Sep 17 00:00:00 2001 From: Barry Deen Date: Thu, 26 Sep 2024 19:07:32 -0400 Subject: [PATCH] remove duplicate static handler declarations --- main.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/main.go b/main.go index cc32bdb..35a6291 100644 --- a/main.go +++ b/main.go @@ -98,10 +98,6 @@ func makeNewRelay(relayType string) *khatru.Relay { }) mux := privateRelay.Router() - static := http.FileServer(http.Dir("templates/static")) - - mux.Handle("GET /static/", http.StripPrefix("/static/", static)) - mux.Handle("GET /favicon.ico", http.StripPrefix("/", static)) mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { tmpl := template.Must(template.ParseFiles("templates/index.html")) @@ -177,10 +173,6 @@ func makeNewRelay(relayType string) *khatru.Relay { }) mux := chatRelay.Router() - static := http.FileServer(http.Dir("templates/static")) - - mux.Handle("GET /static/", http.StripPrefix("/static/", static)) - mux.Handle("GET /favicon.ico", http.StripPrefix("/", static)) mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { tmpl := template.Must(template.ParseFiles("templates/index.html")) @@ -222,10 +214,6 @@ func makeNewRelay(relayType string) *khatru.Relay { }) mux := inboxRelay.Router() - static := http.FileServer(http.Dir("templates/static")) - - mux.Handle("GET /static/", http.StripPrefix("/static/", static)) - mux.Handle("GET /favicon.ico", http.StripPrefix("/", static)) mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { tmpl := template.Must(template.ParseFiles("templates/index.html"))