diff options
Diffstat (limited to 'internal/server/main.go')
-rw-r--r-- | internal/server/main.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/internal/server/main.go b/internal/server/main.go index 95d0369..1ab6cc2 100644 --- a/internal/server/main.go +++ b/internal/server/main.go @@ -2,6 +2,7 @@ package server import ( "apjournal/config" + "apjournal/internal/database/repos" "apjournal/internal/handlers" "context" @@ -9,8 +10,6 @@ import ( "os" "os/signal" "syscall" - - "github.com/jmoiron/sqlx" ) // Server interface @@ -41,9 +40,9 @@ func (srv *server) stopOnSignal(close context.CancelFunc) { os.Exit(0) } -func NewServer(cfg config.Config, log *slog.Logger, conn *sqlx.DB) Server { +func NewServer(cfg config.Config, log *slog.Logger, repo repos.FullRepo) Server { ctx, close := context.WithCancel(context.Background()) - actions := handlers.NewHandlers(cfg, log, conn) + actions := handlers.NewHandlers(cfg, log, repo) return &server{ config: cfg, actions: actions, |