-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.go
36 lines (26 loc) · 799 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
package main
import (
"flag"
// "path/filepath"
"github.com/b3kt/account-srv/config"
"github.com/b3kt/account-srv/router"
"github.com/gin-contrib/cors"
"github.com/gin-gonic/gin"
_ "github.com/golang/glog"
)
func main() {
addr := flag.String("addr", config.Server.Addr, "Address to listen and serve")
flag.Parse()
if config.Server.Mode == gin.ReleaseMode {
gin.DisableConsoleColor()
}
app := gin.Default()
// app.Static("/images", filepath.Join(config.Server.StaticDir, "img"))
// app.StaticFile("/favicon.ico", filepath.Join(config.Server.StaticDir, "img/favicon.ico"))
// app.LoadHTMLGlob(config.Server.ViewDir + "/*")
// app.MaxMultipartMemory = config.Server.MaxMultipartMemory << 20
router.Route(app)
app.Use(cors.Default())
// Listen and Serve
app.Run(*addr)
}