1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

chore: move route registration into the handler classes themselves (resolve #57)

This commit is contained in:
Ferdinand Mütsch
2021-01-30 10:34:52 +01:00
parent a6aff07b21
commit 417d4789ab
12 changed files with 109 additions and 39 deletions

View File

@ -1,6 +1,7 @@
package routes
import (
"github.com/gorilla/mux"
conf "github.com/muety/wakapi/config"
"github.com/muety/wakapi/models"
"github.com/muety/wakapi/models/view"
@ -20,6 +21,12 @@ func NewImprintHandler(keyValueService services.IKeyValueService) *ImprintHandle
}
}
func (h *ImprintHandler) RegisterRoutes(router *mux.Router) {
router.Path("/imprint").Methods(http.MethodGet).HandlerFunc(h.GetImprint)
}
func (h *ImprintHandler) RegisterAPIRoutes(router *mux.Router) {}
func (h *ImprintHandler) GetImprint(w http.ResponseWriter, r *http.Request) {
if h.config.IsDev() {
loadTemplates()