feat(svg): add GET endpoint for all svg templates
build / Go-Build (pull_request) Successful in 1m26s
build / Go-Build (push) Successful in 1m26s

This commit is contained in:
2026-05-18 14:41:25 +02:00
parent 4f9cb5fbe9
commit b378f30c05
2 changed files with 46 additions and 3 deletions
+7 -3
View File
@@ -15,11 +15,15 @@ func PrepareHTTP() {
fmt.Fprintln(w, "You are authorized!")
})
registerAuthorizedFunc("/svg/", func(w http.ResponseWriter, r *http.Request) {
if r.Method != "POST" {
http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)
switch r.Method {
case "POST":
routes.CreateSVG(w, r)
return
case "GET":
routes.Get(w, r)
return
}
routes.CreateSVG(w, r)
http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)
})
registerAuthorizedFunc("/svg/{id}", func(w http.ResponseWriter, r *http.Request) {
switch r.Method {