mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-26 11:28:46 +08:00
26 lines
407 B
Go
26 lines
407 B
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
|
|
"zero/core/conf"
|
|
"zero/ngin"
|
|
"zero/tools/goctl/api/demo/config"
|
|
"zero/tools/goctl/api/demo/handler"
|
|
)
|
|
|
|
var configFile = flag.String("f", "etc/user.json", "the config file")
|
|
|
|
func main() {
|
|
flag.Parse()
|
|
|
|
var c config.Config
|
|
conf.MustLoad(*configFile, &c)
|
|
|
|
engine := ngin.MustNewEngine(c.NgConf)
|
|
defer engine.Stop()
|
|
|
|
handler.RegisterHandlers(engine)
|
|
engine.Start()
|
|
}
|