Skip to content
/ pobox Public

Pobox is a easy-to-run server for receiving and logging web hooks

License

Notifications You must be signed in to change notification settings

clagraff/pobox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CircleCI GoDoc Go Report Card

pobox

POBox is a eary-to-run web server which will accept and log all incoming requests.

POBox provides a simple solution for mocking API requests and responses, as well as a method for loggin web hooks and integrations.

⚠️ Right now pobox is still in progress, and does't have any releases. For now, run at your own risk ⚠️

Quickstart

POBox is a Golang application. As such, you will need to Go installed in order to run the application.

$ go install github.com/clagraff/pobox
$ pobox

After that, use cURL to see it in action:

$ curl localhost:8080
$ curl -X POST -d 'this is data!' localhost:8080/whatever/route/i/want
$ curl -X OPTIONS localhost:8080/fiiz/buzz?anything=here

Routes

Using the pobox <route-file> argument, you can specify a .json or .yaml file which supplies pre-defined routes.

These routes specify a regex pattern for which URIs and methods to react to, and supply response information.

This is useful in the event a web-hook requires a specific response back.

Here is an example .yaml route file:

# routes.yaml
-
    request:
        uri: /[fF]izz/buz{1,3}  # regex pattern for matching URIs
        method: get|post        # regex pattern for matching request methods
    response:
        body: |                 # Multi-line string response
            <html>
                <body>
                    <h1>My Response</h1>
                    <p>this is my response</p>
                </body>
            </html>
$ pobox routes.yaml &
$ curl http://localhost/hello/world
$ curl http://localhost/Fizz/buzz
<html>
    <body>
        <h1>My Response</h1>
        <p>this is my response</p>
    </body>
</html>

About

Pobox is a easy-to-run server for receiving and logging web hooks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages