forked from go-ignite/ignite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
36 lines (29 loc) · 602 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"
"fmt"
"github.com/gin-gonic/gin"
"github.com/go-ignite/ignite/controllers"
"github.com/go-ignite/ignite/utils"
)
var (
confPath = flag.String("c", "./conf/config.toml", "config file")
versionFlag = flag.Bool("v", false, "version")
version = "unknown"
)
func main() {
flag.Parse()
if *versionFlag {
fmt.Println(version)
return
}
utils.InitConf(*confPath)
initRouter()
}
func initRouter() {
r := gin.Default()
r.Static("/static", "./static")
r.LoadHTMLGlob("templates/*")
mainRouter := &controllers.MainRouter{}
mainRouter.Initialize(r)
}