21 lines
502 B
Go
21 lines
502 B
Go
package router
|
|
|
|
import (
|
|
"github.com/ekzyis/magicwallet/pages"
|
|
"github.com/ekzyis/magicwallet/server/router/context"
|
|
"github.com/ekzyis/magicwallet/server/router/middleware"
|
|
"github.com/labstack/echo/v4"
|
|
)
|
|
|
|
type Context = context.Context
|
|
|
|
func Handle(e *echo.Echo, hc Context) {
|
|
e.GET("/", HandleIndex(hc), middleware.Session(hc))
|
|
}
|
|
|
|
func HandleIndex(hc Context) echo.HandlerFunc {
|
|
return func(ec echo.Context) error {
|
|
return pages.Index().Render(hc.WithContext(ec), ec.Response().Writer)
|
|
}
|
|
}
|