Last active
February 9, 2020 23:13
-
-
Save circa10a/660f22f747f6d3fa0a8122153986be95 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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