4 releases (2 breaking)

0.3.0 Mar 24, 2022
0.2.1 Mar 22, 2022
0.2.0 Mar 22, 2022
0.1.0 Mar 20, 2022

#2 in #webhooks

Apache-2.0

15KB
214 lines

tide-github

Process Github webhooks in tide.

API docs

use tide_github::Event;

#[async_std::main]
async fn main() -> tide::Result<()> {
    let mut app = tide::new();
    let github = tide_github::new("My Github webhook s3cr#t")
        .on(Event::IssueComment, |payload| {
            println!("Got payload for repository {}", payload.repository.name);
        })
        .build();
    app.at("/gh_webhooks").nest(github);
    app.listen("127.0.0.1:3000").await?;
    Ok(())
}

lib.rs:

Process Github webhooks in tide.

Example

#[async_std::main]
async fn main() -> tide::Result<()> {
    let mut app = tide::new();
    let github = tide_github::new("My Github webhook s3cr#t")
        .on(Event::IssueComment, |payload| {
            println!("Received a payload for repository {}", payload.repository.name);
        })
        .build();
    app.at("/gh_webhooks").nest(github);
    app.listen("127.0.0.1:3000").await?;
    Ok(())
}

The API is still in development and may change in unexpected ways.

Dependencies

~25–42MB
~804K SLoC