feat(svg): add GET endpoint for all svg templates
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user