Last active
March 5, 2021 02:02
-
-
Save Hopefuls/9fc6d88c4657481a13fba4cda67b9338 to your computer and use it in GitHub Desktop.
Template for my GitHub webhook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GitHubContext implements HttpHandler { | |
@Override | |
public void handle(HttpExchange exchange) throws IOException { | |
RequestManager requestManager = new RequestManager(exchange); | |
ResponseManager responseManager = new ResponseManager(exchange); | |
System.out.println("Received!! hello!"); | |
JSONObject object = requestManager.asJson(); | |
responseManager.writeResponse("thanks lol"); | |
responseManager.setResponseCode(200); | |
HandleLog.handleLogging(object, requestManager.getHeaders().getFirst("X-GitHub-Event")); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment