Skip to content

Instantly share code, notes, and snippets.

@micahwalter
Created January 4, 2024 18:23
Show Gist options
  • Save micahwalter/7b5e026e3f2fd2bcbebf902937aef8ed to your computer and use it in GitHub Desktop.
Save micahwalter/7b5e026e3f2fd2bcbebf902937aef8ed to your computer and use it in GitHub Desktop.

Revisions

  1. micahwalter created this gist Jan 4, 2024.
    27 changes: 27 additions & 0 deletions webhook.go
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    package main

    import (
    "fmt"
    "net/http"
    "os"

    "github.com/aws/aws-lambda-go/lambda"
    )

    func handler() {

    url := os.Getenv("AMPLIFY_WEBHOOK_URL")

    fmt.Printf("Sending to webhook: %s", url)

    _, err := http.Post(url, "application/json", nil)

    if err != nil {
    fmt.Println(err)
    }

    }

    func main() {
    lambda.Start(handler)
    }