trucs inutilesé

This commit is contained in:
gom-by
2025-01-17 15:38:36 +01:00
parent 89f44f4469
commit 9d9b5a5145
13 changed files with 1119 additions and 51 deletions

View File

@@ -10,14 +10,6 @@ import (
func HandleGetBlog(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
if r.Method != http.MethodGet {
core.JSONError{
Status: core.Error,
Message: "Method not Allowed",
}.Respond(w, http.StatusMethodNotAllowed)
return
}
blog_uuid := r.PathValue("uuid")
var blog core.Blog

View File

@@ -70,7 +70,9 @@ func main() {
// "/users/{user_uuid}/events/{event_uuid}/delete": {Handler: nil, Middleware: nil},
// "/users/{user_uuid}/events/{event_uuid}/update": {Handler: nil, Middleware: nil},
"/blogs/new": {Handler: api.HandleCreateBlog, Middlewares: nil},
"/blogs/{uuid}": {Handler: api.HandleGetBlog, Middlewares: nil},
"/blogs/{uuid}": {
Handler: api.HandleGetBlog,
Middlewares: []core.Middleware{api.Methods("GET")}, },
})
fmt.Printf("Serving on port %s\n", port)