Reorganized routes definitions
This commit is contained in:
29
backend/api/shortcodes_routes.go
Normal file
29
backend/api/shortcodes_routes.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"fr.latosa-escrima/api/shortcodes"
|
||||
"fr.latosa-escrima/core"
|
||||
)
|
||||
|
||||
var ShortcodesRoutes = map[string]core.Handler{
|
||||
"/shortcodes/new": {
|
||||
Handler: shortcodes.HandleNew,
|
||||
Middlewares: []core.Middleware{Methods("POST"), AuthJWT},
|
||||
},
|
||||
"/shortcodes/": {
|
||||
Handler: shortcodes.HandleShortcodes,
|
||||
Middlewares: []core.Middleware{Methods("GET"), AuthJWT},
|
||||
},
|
||||
"/shortcodes/{shortcode}": {
|
||||
Handler: shortcodes.HandleShortcode,
|
||||
Middlewares: []core.Middleware{Methods("GET")},
|
||||
},
|
||||
"/shortcodes/{shortcode}/delete": {
|
||||
Handler: shortcodes.HandleDelete,
|
||||
Middlewares: []core.Middleware{Methods("DELETE"), AuthJWT},
|
||||
},
|
||||
"/shortcodes/{shortcode}/update": {
|
||||
Handler: shortcodes.HandleUpdate,
|
||||
Middlewares: []core.Middleware{Methods("PATCH"), AuthJWT},
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user