From 48f104650fa8dd539e97acfddb2ba9a63ff6a451 Mon Sep 17 00:00:00 2001 From: Jason Streifling Date: Wed, 4 Oct 2023 18:55:48 +0200 Subject: [PATCH] =?UTF-8?q?Code=20zu=20Hinzuf=C3=BCgen=20eines=20Teilnehme?= =?UTF-8?q?rs=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.go b/main.go index 1c2098d..bb28da0 100644 --- a/main.go +++ b/main.go @@ -29,9 +29,14 @@ type Briefing struct { func main() { mux := http.NewServeMux() + + mux.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("static/")))) mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { template.Must(template.ParseFiles("templates/index.html")).Execute(w, nil) }) + mux.HandleFunc("/add-participant/", func(w http.ResponseWriter, r *http.Request) { + template.Must(template.ParseFiles("templates/index.html", "templates/participant.html")).ExecuteTemplate(w, "participant", nil) + }) log.Fatalln(http.ListenAndServe(":8080", mux)) }