예제 #1
0
func init() {
	logs.Init(Debug)

	fmt.Println("Reading config...")
	if err := router.Init("../data/config.json"); err != nil {
		fmt.Errorf("Init() failed: %s", err)
	}
}
예제 #2
0
func init() {
	var configFile string
	flag.BoolVar(&Debug, "debug", false, "Activates debug logging.")
	flag.StringVar(&configFile, "config", "data/config.json", "Config file. This is a full or relative path.")
	flag.Parse()

	logs.Init(Debug)

	if err := router.Init(configFile); err != nil {
		log.Fatal("Unable to start - data initilization failed.\n")
	}

	go signalHandler(make(chan os.Signal, 1))
	fmt.Println("Press Ctrl-C to shutdown...")

	time.Sleep(time.Second * 2)
	services.Refresh()
}