From 445455f3417bd3544d0c05140777ff07294088b0 Mon Sep 17 00:00:00 2001 From: Patryk Hegenberg Date: Thu, 7 Mar 2024 08:14:27 +0100 Subject: [PATCH 1/2] added README.md --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..34428ea --- /dev/null +++ b/README.md @@ -0,0 +1,12 @@ +# ddServer + +This is a simple Webserver, which helps zou creating monsters for a dungeons & dragons game + +## Installation +Either clone the repo and build it your self. +- You need to have go installed for that + +Or download the latest release and start your server with +```bash +./ddServer +``` From e67cc692ba8cd3b0879b5abf41bcc8054ab7afd4 Mon Sep 17 00:00:00 2001 From: Patryk Hegenberg Date: Fri, 20 Jun 2025 13:21:08 +0200 Subject: [PATCH 2/2] refactor: replace interface with any --- handlers/about_handler.go | 2 +- handlers/contact_handler.go | 2 +- handlers/form_handler.go | 2 +- handlers/main_handler.go | 2 +- handlers/monster_table_handler.go | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/handlers/about_handler.go b/handlers/about_handler.go index 5f8a1dd..1d628e0 100644 --- a/handlers/about_handler.go +++ b/handlers/about_handler.go @@ -25,7 +25,7 @@ func AboutHandler(content embed.FS) http.HandlerFunc { } // Execute the template with the provided data - data := map[string]interface{}{ + data := map[string]any{ "Title": "Dungeons & Dragons Monster Generator", } err = tmpl.ExecuteTemplate(w, "about", data) diff --git a/handlers/contact_handler.go b/handlers/contact_handler.go index a01cad4..611abc2 100644 --- a/handlers/contact_handler.go +++ b/handlers/contact_handler.go @@ -23,7 +23,7 @@ func ContactHandler(content embed.FS) http.HandlerFunc { } // Execute the contact template - err = tmpl.ExecuteTemplate(w, "contact", map[string]interface{}{ + err = tmpl.ExecuteTemplate(w, "contact", map[string]any{ "Title": "Dungeons & Dragons Monster Generator", }) if err != nil { diff --git a/handlers/form_handler.go b/handlers/form_handler.go index c31cee4..1232463 100644 --- a/handlers/form_handler.go +++ b/handlers/form_handler.go @@ -42,7 +42,7 @@ func FormHandler(content embed.FS, monsters *[]model.Monster) http.HandlerFunc { } // Execute the template and render the response. - data := map[string]interface{}{ + data := map[string]any{ "Title": "Dungeons & Dragons Monster Generator", "Monsters": *monsters, } diff --git a/handlers/main_handler.go b/handlers/main_handler.go index f060e3b..e4b575e 100644 --- a/handlers/main_handler.go +++ b/handlers/main_handler.go @@ -28,7 +28,7 @@ func MainHandler(content embed.FS, monsters *[]model.Monster) http.HandlerFunc { defer mu.Unlock() // Execute the main template with the provided data - err = tmpl.ExecuteTemplate(w, "main", map[string]interface{}{ + err = tmpl.ExecuteTemplate(w, "main", map[string]any{ "Title": "Dungeons & Dragons Monster Generator", "Monsters": *monsters, }) diff --git a/handlers/monster_table_handler.go b/handlers/monster_table_handler.go index 4755386..f227962 100644 --- a/handlers/monster_table_handler.go +++ b/handlers/monster_table_handler.go @@ -24,7 +24,7 @@ func MonsterTableHandler(content embed.FS, monsters *[]model.Monster) http.Handl } // Execute the template and pass the necessary data - err = tmpl.ExecuteTemplate(w, "monsterTable", map[string]interface{}{ + err = tmpl.ExecuteTemplate(w, "monsterTable", map[string]any{ "Title": "Dungeons & Dragons Monster Generator", "Monsters": *monsters, })