features/working-on-scopes #13

Merged
jtom38 merged 28 commits from features/working-on-scopes into main 2024-04-04 15:31:54 -07:00
Showing only changes of commit 0d253270b7 - Show all commits

View File

@ -3,6 +3,7 @@ package main
import ( import (
"database/sql" "database/sql"
v1 "go-cook/api/handlers/v1" v1 "go-cook/api/handlers/v1"
"go-cook/api/services"
"log" "log"
"net/http" "net/http"
@ -21,6 +22,8 @@ func main() {
log.Fatal(err) log.Fatal(err)
} }
cfg := services.NewEnvConfig()
e := echo.New() e := echo.New()
e.Validator = &CustomValidator{ e.Validator = &CustomValidator{
validator: validator.New(), validator: validator.New(),
@ -30,7 +33,7 @@ func main() {
e.Pre(middleware.Recover()) e.Pre(middleware.Recover())
v1Group := e.Group("/api/v1") v1Group := e.Group("/api/v1")
v1Api := v1.NewHandler(db) v1Api := v1.NewHandler(db, cfg)
v1Api.Register(v1Group) v1Api.Register(v1Group)
e.Logger.Fatal(e.Start(":1323")) e.Logger.Fatal(e.Start(":1323"))