trucs inutilesé
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user