change route handling to ServeMux for better performance and readability

This commit is contained in:
Patryk Hegenberg 2023-12-07 08:08:04 +01:00
parent 3a77eb1593
commit 2d0d0697fb
3 changed files with 17 additions and 14 deletions

View file

@ -13,7 +13,7 @@ import (
// and a filename string as parameters.
// The function parses the template files from the content FS,
// executes the template with the provided data, and renders it as a response.
func FormHandler(content embed.FS, monsters *[]model.Monster, filename string) http.HandlerFunc {
func FormHandler(content embed.FS, monsters *[]model.Monster) http.HandlerFunc {
log.Print("FormHandler called")
// Lock the mutex to ensure exclusive access to the monsters slice.