From cbd5c09c5e1403709d4aabf91051443f147689e5 Mon Sep 17 00:00:00 2001 From: Anhgelus Morhtuuzh Date: Mon, 22 Dec 2025 18:34:02 +0100 Subject: refactor(backend): move db related in new package --- main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index 4f2fd6b..b1a192e 100644 --- a/main.go +++ b/main.go @@ -15,6 +15,7 @@ import ( "time" "git.anhgelus.world/anhgelus/small-web/backend" + "git.anhgelus.world/anhgelus/small-web/backend/storage" "github.com/joho/godotenv" ) @@ -61,9 +62,9 @@ func main() { ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) defer cancel() - db := backend.ConnectDatabase(cfg) + db := storage.ConnectDatabase(cfg.Database) defer db.Close() - err := backend.RunMigration(ctx, db) + err := storage.RunMigration(ctx, db) if err != nil { panic(err) } -- cgit v1.2.3