-
Notifications
You must be signed in to change notification settings - Fork 0
/
wxserver.go
48 lines (33 loc) · 1003 Bytes
/
wxserver.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
package main
import (
_"prosnav.com/wxserver/utils"
"github.com/gin-gonic/gin"
"prosnav.com/wxserver/modules/setting"
"prosnav.com/wxserver/modules/mail"
"prosnav.com/wxserver/controllers"
"prosnav.com/wxserver/midwares"
"prosnav.com/wxserver/modules/results"
"fmt"
)
func ginDemo() {
root := gin.New()
appContext := fmt.Sprintf("/%s", setting.AppName)
rootGroup := root.Group(appContext)
version := fmt.Sprintf("/%s", setting.AppVer)
verGroup := rootGroup.Group(version,
//log.Logger(),
midwares.SecurityAccess(),
midwares.AccessControl(),
gin.Recovery(),
results.ErrorHandler(),
//ginpongo2.Pongo2(),
)
controllers.RegisterHandlers(verGroup)
root.Run(setting.ListeningPort)
}
func init() {
mail.NewMailerContext()
}
func main() {
ginDemo()
}