forked from soldank-plus-plus/spp-lobby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
42 lines (31 loc) · 1 KB
/
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
34
35
36
37
38
39
40
41
42
package main
import (
"log"
"github.com/nedik/spp-lobby/controllers"
"github.com/nedik/spp-lobby/initializers"
"github.com/nedik/spp-lobby/routes"
"github.com/gin-gonic/gin"
)
var (
FaviconController controllers.FaviconController
FaviconRouteController routes.FaviconRouteController
ServerController controllers.ServerController
ServerRouteController routes.ServerRouteController
)
func init() {
FaviconController = controllers.NewFaviconController()
FaviconRouteController = routes.NewFaviconRouteController(FaviconController)
ServerController = controllers.NewServerController()
ServerRouteController = routes.NewServerRouteController(ServerController)
}
func main() {
config, err := initializers.LoadConfig(".")
if err != nil {
log.Fatal("Could not load environment variables", err)
}
server := gin.Default()
router := server.Group("/")
ServerRouteController.InitServerRoutes(router)
FaviconRouteController.InitFaviconRoutes(router)
log.Fatal(server.Run(":" + config.ServerPort))
}