Implement create and get incoming webhook endpoints for APIv4 (#5407)

* Implement POST /hooks/incoming endpoint for APIv4

* Implement GET /hooks/incoming endpoint for APIv4

* Updates per feedback
Этот коммит содержится в:
Joram Wilander
2017-02-21 19:42:34 -05:00
коммит произвёл GitHub
родитель b61115df55
Коммит 69cac604e0
11 изменённых файлов: 414 добавлений и 51 удалений

Просмотреть файл

@@ -52,11 +52,11 @@ type Routes struct {
Command *mux.Router // 'api/v4/commands/{command_id:[A-Za-z0-9]+}'
CommandsForTeam *mux.Router // 'api/v4/teams/{team_id:[A-Za-z0-9]+}/commands'
Hooks *mux.Router // 'api/v4/teams/hooks'
IncomingHooks *mux.Router // 'api/v4/teams/hooks/incoming'
IncomingHook *mux.Router // 'api/v4/teams/hooks/incoming/{hook_id:[A-Za-z0-9]+}'
OutgoingHooks *mux.Router // 'api/v4/teams/hooks/outgoing'
OutgoingHook *mux.Router // 'api/v4/teams/hooks/outgoing/{hook_id:[A-Za-z0-9]+}'
Hooks *mux.Router // 'api/v4/hooks'
IncomingHooks *mux.Router // 'api/v4/hooks/incoming'
IncomingHook *mux.Router // 'api/v4/hooks/incoming/{hook_id:[A-Za-z0-9]+}'
OutgoingHooks *mux.Router // 'api/v4/hooks/outgoing'
OutgoingHook *mux.Router // 'api/v4/hooks/outgoing/{hook_id:[A-Za-z0-9]+}'
OAuth *mux.Router // 'api/v4/oauth'
@@ -145,6 +145,7 @@ func InitApi(full bool) {
InitPost()
InitFile()
InitSystem()
InitWebhook()
app.Srv.Router.Handle("/api/v4/{anything:.*}", http.HandlerFunc(Handle404))