github.com/matthieudolci/hatcher@v0.2.8/api/handler.go (about)

     1  package api
     2  
     3  import (
     4  	"net/http"
     5  
     6  	"github.com/matthieudolci/hatcher/common"
     7  
     8  	"github.com/julienschmidt/httprouter"
     9  	"github.com/matthieudolci/hatcher/bot"
    10  )
    11  
    12  // Handler instantiaties the web handler for listening on the API
    13  func Handler(s *common.Slack) (http.Handler, error) {
    14  
    15  	router := httprouter.New()
    16  
    17  	// main API endpoint with slack
    18  	router.POST("/slack", bot.SlackPostHandler(s))
    19  
    20  	return router, nil
    21  }