Skip to content

Instantly share code, notes, and snippets.

@circa10a
Last active February 9, 2020 23:13
Show Gist options
  • Save circa10a/660f22f747f6d3fa0a8122153986be95 to your computer and use it in GitHub Desktop.
Save circa10a/660f22f747f6d3fa0a8122153986be95 to your computer and use it in GitHub Desktop.
package main
import (
"net/http"
"github.com/gin-gonic/gin"
log "github.com/sirupsen/logrus"
)
func handleWebhook(c *gin.Context) {
c.JSON(http.StatusOK, buildFulfillment())
}
func main() {
var err error
r := gin.Default()
r.POST("/webhook", handleWebhook)
if err = r.Run(); err != nil {
log.WithError(err).Fatal("Couldn't start server")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment