Refactored code and added logging

This commit is contained in:
Artyom Belousov 2019-11-03 12:16:45 +03:00
parent 8830920900
commit 221ab214cc
11 changed files with 51 additions and 44 deletions

View file

@ -13,10 +13,9 @@ import (
func main() {
rand.Seed(time.Now().UTC().UnixNano())
logFile, _ := os.OpenFile("logs/errors.log", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
defer logFile.Close()
log.SetOutput(logFile)
r := gin.Default()
r.POST("callback/message", vk.HandleMessage)
r.Run(":80")
_ = r.Run(":80")
}