Merge pull request #16 from bitvora/dev-staticBugFix

remove duplicate static handler declarations
This commit is contained in:
Barry Deen
2024-09-26 19:07:52 -04:00
committed by GitHub

12
main.go
View File

@@ -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"))