-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
33 lines (24 loc) · 883 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package main
import (
"github.com/gin-gonic/gin"
"github.com/shaikrasheed99/golang-user-jwt-authentication/configs"
"github.com/shaikrasheed99/golang-user-jwt-authentication/database"
"github.com/shaikrasheed99/golang-user-jwt-authentication/handlers"
"github.com/shaikrasheed99/golang-user-jwt-authentication/repositories"
"github.com/shaikrasheed99/golang-user-jwt-authentication/routes"
"github.com/shaikrasheed99/golang-user-jwt-authentication/services"
)
func main() {
configs.LoadConfigs()
db := database.InitDatabase()
ur := repositories.NewUserRepository(db)
ar := repositories.NewAuthRepository(db)
us := services.NewUserService(ur)
as := services.NewAuthService(ar)
ah := handlers.NewAuthHandler(us, as)
uh := handlers.NewUserHandler(us, as)
app := gin.Default()
routes.RegisterAuthRoutes(app, ah)
routes.RegisterUserRoutes(app, uh)
app.Run()
}