Commit 0e8d2557 authored by Sytse Sijbrandij's avatar Sytse Sijbrandij
Browse files

Merge branch 'endpoint_example' into 'master'

Add an example webhook receiver
......@@ -112,3 +112,34 @@ Triggered when a new merge request is created or an existing merge request was u
#### Example webhook receiver
If you want to see GitLab's webhooks in action for testing purposes you can use
a simple echo script running in a console session.
Save the following file as `print_http_body.rb`.
require 'webrick'
server = ARGV.first)
server.mount_proc '/' do |req, res|
puts req.body
trap 'INT' do server.shutdown end
Pick an unused port (e.g. 8000) and start the script: `ruby print_http_body.rb
8000`. Then add your server as a webhook receiver in GitLab as
When you press 'Test Hook' in GitLab, you should see something like this in the console.
localhost - - [14/May/2014:07:45:26 EDT] "POST / HTTP/1.1" 200 0
- -> /
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment