Skip to content

Implement hooks #4

Open
Open
@zorbash

Description

@zorbash

Currently one can update a widget either using a job or HTTP POST to /widgets/:id.

We could also allow settings hooks for easier integration with external services.

Example usage with GitHub webhooks:

# File: hooks/github.exs

hook :github_issues do
  issue = body |> Poison.decode!

  # Other, heavier processing can be added here
 
  broadcast! :github_issues, 
             %{user: issue |> get_in(["sender", "login"]), 
               title: issue |> get_in(["issue", "title"])}
end 

Kitto with the above hook definition would pass the request context and handling of POST /hooks/github_issues to the code in the hook.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions