Пример #1
0
func main() {

	config = common.GetConfig()

	http.HandleFunc("/", serveHomePage)
	http.Handle("/assets/", http.FileServer(http.Dir("templates/")))

	webHookUrl := biubot.GetWebHookUrl()
	http.HandleFunc(webHookUrl, serveWebHook)

	hostname, _ := os.Hostname()
	// auto change
	if hostname != "jsxqfdeMac-mini.local" {
		err := http.ListenAndServe(":"+os.Getenv("PORT"), nil)
		util.PanicIf(err)
	} else {
		err := http.ListenAndServe(":8080", nil)
		util.PanicIf(err)
	}

}
Пример #2
0
func init() {

	config = common.GetConfig()
}