Feat(log): Additional logging on web-based route
All checks were successful
Webhook-Everything/Webhook-Everything/pipeline/head This commit looks good

This commit is contained in:
2022-05-29 16:14:51 +08:00
parent 15d06cd510
commit b8a9abbd51
2 changed files with 6 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
package webhookeverything
import (
"log"
"net/http"
"net/http/httputil"
)
@@ -19,6 +20,9 @@ func (env *Env) forwardHookToTelegram(r *http.Request, routeID string) error {
return err
}
// Print on screent
log.Println(responseStr)
// Send telegram
env.TelegramEnv.TelegramSend(routeResult.TelegramShortCode, string(responseStr))

View File

@@ -1,6 +1,7 @@
package webhookeverything
import (
"log"
"net/http"
"git.samuelpua.com/telboon/webhook-everything/backend/internal/common"
@@ -21,6 +22,7 @@ import (
func (env *Env) handleWebhook(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
routeID := chi.URLParam(r, "routeID")
log.Printf("Webhook received for routeID: %s", routeID)
_ = ctx
err := env.forwardHookToTelegram(r, routeID)