gh-event-api
![Coverage Status](https://camo.githubusercontent.com/e7df534da538e6994186b5929e3bd346064a70cc8ec02d40a09b7a935fcee797/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f53687265646465723132312f67682d6576656e742d6170692f62616467652e7376673f6272616e63683d6d617374657226736572766963653d676974687562)
GitHub Event API Server
What it does
@SpringBootApplication // You can make a regular Spring Boot application
public class Application {
public static void main(String... args) {
// This starts your app alongside gh-event-api
GHEventApiServer.start(Application.class, args);
}
@Bean // Declaring your handlers as Spring beans will bootstrap them
public PushHandler pushHandler() {
return payload -> {
System.out.println("got payload: " + payload);
};
}
@Bean // You can declare as many handlers as you want/need
public PushHandler anotherPushHandler() {
return payload -> {
System.out.println("got payload: " + payload);
};
}
}
After bootstrapping, the server listens for GitHub events at the configured port. (With sane defaults, courtesy of Spring Boot)
Configuration
Since eventually it's a Spring Boot app, all common application properties for the included version apply.
Examples
There are a few reference implementations of GitHub Event API style webhooks.
GitHub Review Window which is operational, right now mainly on this repository.
SpringIssueMaster which is a POC, based on the behavior of the Spring Issuemaster user.