mirror of
https://github.com/FJurmanovic/wallet-go-api.git
synced 2026-02-06 06:08:16 +00:00
upgraded migrations and context usage
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
"wallet-api/pkg/api"
|
||||
"wallet-api/pkg/middleware"
|
||||
@@ -14,11 +15,12 @@ import (
|
||||
func main() {
|
||||
godotenv.Load()
|
||||
|
||||
ctx := context.Background()
|
||||
dbUrl := os.Getenv("DATABASE_URL")
|
||||
r := gin.New()
|
||||
r.Use(middleware.CORSMiddleware())
|
||||
|
||||
conn := db.CreateConnection(dbUrl)
|
||||
conn := db.CreateConnection(dbUrl, ctx)
|
||||
api.Init(r, conn)
|
||||
|
||||
server.Start(r)
|
||||
|
||||
Reference in New Issue
Block a user