feat: add KV store middleware for session and handle management

This commit is contained in:
2025-05-29 16:23:22 -04:00
parent 786fef8399
commit c4f504773f
9 changed files with 213 additions and 5 deletions

View File

@@ -10,6 +10,7 @@ import (
"github.com/labstack/echo/v4"
"github.com/sonr-io/motr/middleware/database"
"github.com/sonr-io/motr/middleware/kvstore"
"github.com/sonr-io/motr/middleware/marketapi"
"github.com/sonr-io/motr/middleware/session"
"github.com/sonr-io/motr/routes"
@@ -26,7 +27,7 @@ import (
// Setup the HTTP handler
func loadHandler() http.Handler {
e := echo.New()
e.Use(session.Middleware(), database.Middleware(), marketapi.Middleware())
e.Use(session.Middleware(), database.Middleware(), kvstore.Middleware(), marketapi.Middleware())
routes.SetupViews(e)
routes.SetupPartials(e)
return e

View File

@@ -10,6 +10,7 @@ import (
"github.com/labstack/echo/v4"
"github.com/sonr-io/motr/middleware/database"
"github.com/sonr-io/motr/middleware/kvstore"
"github.com/sonr-io/motr/middleware/session"
"github.com/sonr-io/motr/middleware/sonrapi"
"github.com/sonr-io/motr/middleware/webauthn"
@@ -27,7 +28,7 @@ import (
// Setup the HTTP handler
func loadHandler() http.Handler {
e := echo.New()
e.Use(session.Middleware(), database.Middleware(), sonrapi.Middleware(), webauthn.Middleware())
e.Use(session.Middleware(), database.Middleware(), kvstore.Middleware(), sonrapi.Middleware(), webauthn.Middleware())
routes.SetupViews(e)
routes.SetupPartials(e)
return e