33 lines
555 B
Go
33 lines
555 B
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
"homestead/homestead_gateway/controller"
|
|
"homestead/homestead_gateway/util"
|
|
"homestead/homestead_gateway/util/config"
|
|
"os"
|
|
"path"
|
|
)
|
|
|
|
func main() {
|
|
dir := util.GetPath()
|
|
if dir == "" {
|
|
dir, _ = os.Getwd()
|
|
}
|
|
|
|
file := path.Join(dir, "config.toml")
|
|
cfgPath := flag.String("config", file, "configuration file")
|
|
cfg, err := config.LoadConfig(*cfgPath)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
ctrl := controller.NewGatewayController(*cfg)
|
|
err = ctrl.Run()
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
}
|
|
|
|
// todo logs from exe not cwd
|