mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2026-06-16 00:10:14 +00:00
feat: use dig for controllers
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/tinyauthapp/tinyauth/internal/assets"
|
||||
"go.uber.org/dig"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
@@ -18,7 +19,12 @@ type UIMiddleware struct {
|
||||
uiFileServer http.Handler
|
||||
}
|
||||
|
||||
func NewUIMiddleware() (*UIMiddleware, error) {
|
||||
// for future use if we need to inject dependencies into the middleware
|
||||
type UIMiddlewareInput struct {
|
||||
dig.In
|
||||
}
|
||||
|
||||
func NewUIMiddleware(_ UIMiddlewareInput) (*UIMiddleware, error) {
|
||||
m := &UIMiddleware{}
|
||||
|
||||
ui, err := fs.Sub(assets.FrontendAssets, "dist")
|
||||
|
||||
Reference in New Issue
Block a user