Refactored project structure

This commit is contained in:
2025-10-16 22:45:31 +02:00
parent cf74cce51c
commit d13ea9fc27
13 changed files with 1156 additions and 1023 deletions

View File

@@ -0,0 +1,13 @@
package handlers
import (
"encoding/json"
"net/http"
)
func writeJSON(w http.ResponseWriter, v any) {
w.Header().Set("Content-Type", "application/json")
if err := json.NewEncoder(w).Encode(v); err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
}
}