Refactor
This commit is contained in:
parent
97afa8ba6d
commit
b0b5027ee9
9
main.go
9
main.go
@ -191,11 +191,18 @@ func main() {
|
|||||||
log.Fatalf("Error loading .env file")
|
log.Fatalf("Error loading .env file")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// test config read
|
||||||
|
_, err = ReadConfig(os.Getenv("CONFIG_PATH"))
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("cannot read config - " + err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// set webhook
|
// set webhook
|
||||||
http.HandleFunc("/webhook", handleWebhook)
|
http.HandleFunc("/webhook", handleWebhook)
|
||||||
|
|
||||||
// listen server
|
// listen server
|
||||||
fmt.Println("Webhook server listening on :3021")
|
fmt.Println("Webhook server listening on :3021") // @todo make env
|
||||||
err = http.ListenAndServe(":3021", nil)
|
err = http.ListenAndServe(":3021", nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err.Error())
|
panic(err.Error())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user