Git Product home page Git Product logo

webhookd's Introduction

webhookd

webhookd-tests GitHub release (latest by date)

What this project is about

This is a daemon that enables you to run your own webhook service. It provides a route for generating a webhook which serves static content. In the future one should be able to upload signed Plugins that add dynamic capabilities.

How do I install it ?

git clone [email protected]:4thel00z/webhookd.git
make build

Ok, but how do I run this cringelord ? :S

In one terminal you can do:

โžœ  webhookd git:(master) make run
2020/10/29 02:58:38

              ___.   .__                   __       .___
__  _  __ ____\_ |__ |  |__   ____   ____ |  | __ __| _/
\ \/ \/ // __ \| __ \|  |  \ /  _ \ /  _ \|  |/ // __ |
 \     /\  ___/| \_\ \   Y  (  <_> |  <_> )    </ /_/ |
  \/\_/  \___  >___  /___|  /\____/ \____/|__|_ \____ |
             \/    \/     \/                   \/    \/

2020/10/29 02:58:38 ๐Ÿ‘ฉ  Version: 0.0.1
2020/10/29 02:58:38 ๐Ÿ  Listening on [::]:1337
2020/10/29 02:58:38 ๐Ÿ‘   The routes ๐Ÿ›ฃ๏ธ  are:
2020/10/29 02:58:38     http://[::]:1337/v1/debug/routes with method: GET
2020/10/29 02:58:38     Query this endpoint like this:
                curl http://0.0.0.0:1337/v1/debug/routes
2020/10/29 02:58:38     http://[::]:1337/v1/debug/private with method: GET
2020/10/29 02:58:38     Query this endpoint like this:
                curl http://0.0.0.0:1337/v1/debug/private
2020/10/29 02:58:38     http://[::]:1337/v1/webhook/generate with method: POST
2020/10/29 02:58:38     Query this endpoint like this:
                curl -X POST http://0.0.0.0:1337/v1/webhook/generate
2020/10/29 02:58:38     http://[::]:1337/v1/webhook/unregister with method: POST
2020/10/29 02:58:38     Query this endpoint like this:
                curl -X POST http://0.0.0.0:1337/v1/webhook/unregister

Using your favourite http client you can now send a request to the webhookd like this:

โžœ  webhookd git:(master) http POST http://0.0.0.0:1337/v1/webhook/generate < examples/generate_webhook.json
HTTP/1.1 200 OK
Content-Length: 60
Content-Type: application/json
Date: Thu, 29 Oct 2020 01:58:43 GMT

{
    "path": "/v1/webhook/4122493a-fd9b-4ec8-7861-bcafc1e4d5c4"
}

It will return the path under which you can find your webhook. The webhook is defined in an (exemplary) file called examples/generate_webhook.json which can also be found in this repo. We produce it here for brevity:

{
"method" : "get",
"body" : "4thel00z is the real deal",
"headers" : {}
}

We can then simply call the webhook and it will send us back the specified body and headers:

โžœ  webhookd git:(master) โœ— http GET http://0.0.0.0:1337/v1/webhook/4122493a-fd9b-4ec8-7861-bcafc1e4d5c4
HTTP/1.1 200 OK
Content-Length: 28
Content-Type: application/json
Date: Thu, 29 Oct 2020 02:03:12 GMT

"4thel00z is the real deal"

Acknowledgements

We used my serviced_template in the process, if the code strikes you as familiar it's probably because you spend too much time on my Github page.

License

This project is licensed under the GPL-3 license.

webhookd's People

Contributors

4thel00z avatar

Stargazers

 avatar David M. Golembiowski avatar Kostiantyn Masliuk avatar Wade Zhang avatar Song Liu avatar

Watchers

James Cloos avatar  avatar  avatar

webhookd's Issues

Bump service_templated version

The version of service_templated is before libservice and libhttp were refactored out. One critical change was done to the library that was libhttp before it was exposed:

  • The router entries were exposed
  • The router method receiver was changed to be a pointer, to make changes to router entries persistent

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.