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) } }
func init() { config = common.GetConfig() }