upgraded migrations and context usage

This commit is contained in:
Fran Jurmanović
2021-07-03 00:01:25 +02:00
parent 4189a0d333
commit 788ff3a146
33 changed files with 321 additions and 251 deletions

View File

@@ -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)