-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
37 lines (27 loc) · 764 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
34
35
36
37
package main
import (
"log"
"github.com/gin-contrib/pprof"
"github.com/gin-gonic/gin"
"github.com/ms-url-shortner/app/config"
_ "github.com/ms-url-shortner/app/docs"
"github.com/ms-url-shortner/app/logging"
"github.com/ms-url-shortner/app/route"
)
const listenPort = ":4242"
func main() {
gin.SetMode(gin.ReleaseMode)
gin := gin.Default()
pprof.Register(gin)
// gin.Use(middleware.RateLimiter())
config.Initialize()
log.Println("config Initialized Successfully")
logging.Initialize(config.Config)
log.Println("log initialised successfully")
lw := logging.LogForFunc()
route.Initialize(gin)
lw.Debug("routes initialized successfully")
if err := gin.Run(listenPort); err != nil {
lw.Fatal("gin engine failed to run", err.Error())
}
}