Move controller to the template renderer (#68)
This commit is contained in:
parent
baa391fb20
commit
8eafb6b666
26 changed files with 654 additions and 679 deletions
|
|
@ -7,7 +7,6 @@ import (
|
|||
"github.com/labstack/echo-contrib/session"
|
||||
echomw "github.com/labstack/echo/v4/middleware"
|
||||
"github.com/mikestefanello/pagoda/config"
|
||||
"github.com/mikestefanello/pagoda/pkg/controller"
|
||||
"github.com/mikestefanello/pagoda/pkg/middleware"
|
||||
"github.com/mikestefanello/pagoda/pkg/services"
|
||||
)
|
||||
|
|
@ -43,14 +42,14 @@ func BuildRouter(c *services.Container) error {
|
|||
}),
|
||||
session.Middleware(sessions.NewCookieStore([]byte(c.Config.App.EncryptionKey))),
|
||||
middleware.LoadAuthenticatedUser(c.Auth),
|
||||
middleware.ServeCachedPage(c.Cache),
|
||||
middleware.ServeCachedPage(c.TemplateRenderer),
|
||||
echomw.CSRFWithConfig(echomw.CSRFConfig{
|
||||
TokenLookup: "form:csrf",
|
||||
}),
|
||||
)
|
||||
|
||||
// Error handler
|
||||
err := Error{Controller: controller.NewController(c)}
|
||||
err := Error{c.TemplateRenderer}
|
||||
c.Web.HTTPErrorHandler = err.Page
|
||||
|
||||
// Initialize and register all handlers
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue