Skip to content
This repository has been archived by the owner on Sep 10, 2020. It is now read-only.

suriyaa/payload

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

payload Server

💲 A payload server build by Suriyaa Kudo.

Installation

  1. Open two terminals.
  2. Type this in the first terminal:
bundle install
ruby server.rb
  1. And type this in the second terminal (See #1):
ngrok http 8972
  1. Copy the url of ngrok / second terminal and go to https://github.com/SuriyaaKudoIsc/payload/settings/hooks in GitHub repo settings (See #2).

Usage

Since we set up our webhook to listen to events dealing with Issues, go ahead and create a new Issue on the repository you're testing with. Once you create it, switch back to your terminal. You should see something like this in your output:

~/Developer/platform-samples/hooks/ruby/configuring-your-server $ ruby server.rb
== Sinatra/1.4.4 has taken the stage on 4567 for development with backup from Thin
>> Thin web server (v1.5.1 codename Straight Razor)
>> Maximum connections set to 1024
>> Listening on localhost:4567, CTRL+C to stop
I got some JSON: {"action"=>"opened", "issue"=>{"url"=>"...

🎉 Success! You've successfully configured your server to listen to webhooks. Your server can now process this information any way you see fit. For example, if you were setting up a "real" web application, you might want to log some of the JSON output to a database.