GithubHelp home page GithubHelp logo

copperzen's Introduction

copperegg_webhooks_handler

  • This is example code provided by CopperEgg for our customers who are using Webhooks.
  • This ruby code:
    • runs sinatra on thin;
    • it completely parses and decodes all CopperEgg webhook system and probe alerts;
    • each alert type is broken-down to an individual method, which prints a message to
  • stdout;
    
    • these individual methods can be modified to execute code to restart your server,
  • scale your number of servers, or whatever else you choose to do.
    

Requirements

sinatra, thin, json

Platform

  • This code runs on any ruby platform compatable with sinatra.

Usage

  • For testing your code locally:
    • Open a terminal window on your local dev system
    • clone this repo to your dev system
    • install sinatra, json and thin gems
    • run bundle
    • run the program:
  • ruby webhooks.rb
    • thin / sinatra will start up a local webserver on your dev machine, which can be
  • accessed at localhost:4567
    
    • create an internet-visible proxy for your local webserver ... for example using
  • proxylocal; (find it at http://proxylocal.com)
  • in a separate terminal window, run proxylocal:4567
  • proxylocal will display a public IP that you can use to access your local web server
    • copy the address provided by proxylocal.com into the 'webhook' field on the alert
  • definitions of your choice.
    • you will see the decoded webhook information displayed on your 'sinatra' terminal.

Links

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.