go-file-serve/main.go
2019-02-25 22:56:48 +08:00

32 lines
480 B
Go

package main
import (
"fmt"
"log"
"git.trj.tw/golang/go-file-serve/module/config"
"git.trj.tw/golang/go-file-serve/module/flags"
"git.trj.tw/golang/go-file-serve/routes"
)
func init() {
flags.RegFlags()
}
func main() {
var err error
flag := flags.GetFlags()
err = config.LoadConfig(flag.ConfigPath)
if err != nil {
log.Fatal(err)
}
conf := config.GetConf()
engine := routes.NewEngine()
routes.SetRoutes(engine)
engine.Run(fmt.Sprintf(":%d", conf.Port))
}