Open tonyalaribe opened 7 years ago
I had to copy over SetWebhook implementation since I had only 1 http port available.
Lmao... @kelonye seems i'm not the only one in the challenge. Thanks for the headsup.
Most http frameworks seem to have a way to use a http.Handler to handle specific paths.
If you pass the mux
of callbacks, mux := bot.SetWebhook("/webhook")
into it, it should just work.
For my app (using gin) I had to do:
router.GET("/webhook", gin.WrapH(mux))
router.POST("/webhook", gin.WrapH(mux))
For julienschmidt/httprouter it looks like this method will do what you want, but I've not tried it: https://godoc.org/github.com/julienschmidt/httprouter#Router.Handler
I have an eccomerce platform, and would like to build a facebook bot to interact with the platform. I;m currently using julienschmidt/httprouter for routing. How can i attach the webhook to the router?