Project

postbin

0.02
No commit activity in last 3 years
No release in over 3 years
A ruby command line/rack application for testing systems that send WebHooks using a HTTP POST request. Requests can be viewed via a simple web interface.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.1
~> 5.14
~> 1.1
~> 13.0
~> 0.9

Runtime

~> 2.0
~> 2.0
~> 1
 Project Readme

PostBin

PostBin, a simple web service for testing and logging of the receival of WebHooks (HTTP POST requests).

Quick Start: Stand Alone

$ gem install postbin
$ postbin
== Starting PostBin on http://127.0.0.1:6969
== Sinatra/1.3.1 has taken the stage on 6969 for development with backup from Thin
>> Thin web server (v1.2.11 codename Bat-Shit Crazy)
>> Maximum connections set to 1024
>> Listening on 127.0.0.1:6969, CTRL+C to stop

When running postbin from the command line, requests are stored in a temporary file database, they will be lost once the server terminates.

You can then submit a basic POST request using curl as follows:

curl --header "Content-Type: application/json" \
  --request POST \
  --data '{"foo":"bar", "hello":"world", "number": 42}' \
  http://127.0.0.1:6969/my/fake/path

Rar

Quick Start: Rack Application

You can run a more permeant install by running PostBin as a Rack application:

# example config.ru
require 'postbin'

# path of pstore file to use for storage.
pstore = File.expand_path(File.join(File.dirname(__FILE__), 'postbin.pstore'))

# start the server.
PostBin::Server.set :pstore_file, pstore
run PostBin::Server.new(pstore)

Command Line Options

Usage: postbin [options]

PostBin options:
  -v, --version            show version number
  -h, --help               show this message

Rack options:
  -s, --server SERVER      server (webrick, mongrel, thin, etc.)
  -a, --address HOST       listen on HOST address (default: 127.0.0.1)
  -p, --port PORT          use PORT number (default: 6969)

Quick Start: Local Development

Local development/testing is handled by rake tasks for the most part:

# list available `rake` task
rake -T
# build and install gem
rake install

If you wish to build/test a set of uncommited changes:

# build gem
gem build postbin.gemspec
# install gem (adjust as needed)
gem install postbin-<VERSION>.gem

Release Instructions

  1. Bump the version number found in lib/postbin/version.rb.
  2. Tag git repo with the same version number.
  3. Publush .gem to https://rubygems.org/:
# ensure tests pass first
rake test
# build a new gem
rake build
# release the new gem
rake release