-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
45 lines (34 loc) · 865 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
38
39
40
41
42
43
44
45
/**
********************************************************************************************
* Created by run-code.
* User: shijl
* Date: 2018/12/03
* Time: 10:18
********************************************************************************************
*/
package main
import (
"time"
"github.com/gin-gonic/gin"
"run-code/log"
"run-code/router"
"run-code/config"
"run-code/middleware"
)
func main() {
r := gin.New()
//=====config=====
// config init
//=====mode=====
//gin.SetMode(gin.ReleaseMode)
gin.SetMode(config.AppConf.Model)
//=====logger=====
log.ConfigLocalFilesystemLogger(log.Log, "runtime", "app.log", time.Hour*360, time.Hour)
//=====middleware=====
r.Use(middleware.LoggerMiddleware(log.Log))
r.Use(gin.Recovery())
//=====route=====
router.InitRunRouter(r)
//=====run=====
r.Run(config.AppConf.Address)
}