aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2025-12-22 18:34:02 +0100
committerAnhgelus Morhtuuzh <william@herges.fr>2025-12-22 18:34:02 +0100
commitcbd5c09c5e1403709d4aabf91051443f147689e5 (patch)
tree5add0c1a15df56ec121a77f3d4bd895c7d5f19df /main.go
parent9bba6dcbb2e83fe53604d38b89fb79ce47eacddd (diff)
refactor(backend): move db related in new package
Diffstat (limited to 'main.go')
-rw-r--r--main.go5
1 files changed, 3 insertions, 2 deletions
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)
}