🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

sns_endpoint

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sns_endpoint

0.1
Rubygems
Version published
Maintainers
1
Created
Source

SnsEndpoint

Simple gem containing Sinatra engine, designed to help you utilize SNS http post service. Use inside Rails (as an engine) or outside - as a standalone application.

Installation

Add this line to your application's Gemfile:

gem 'sns_endpoint'

And then execute:

$ bundle

Or install it yourself as:

$ gem install sns_endpoint

Usage

Configure using SnsEndpoint.setup, providing block, like this:

SnsEndpoint.setup do |config|
  config.topics_list = ['first_topic', 'second_topic'] #list of topics that endpoint should respond to subscription request
  config.subscribe_proc = Proc.new { |message| p message } #proc that should be executed when subscribe request got received and responded to, passed argument is message (json object)
  config.message_proc = Proc.new { |message| p message } #proc that should be executed when message got send to endpoint
end

for example in Rails initializer.

Use as Rails engine:

  • mount in routes.rb:
mount SnsEndpoint::Core => "/sns_endpoint"

Use as a standalone app: Example script:

require 'rubygems'
require 'sns_endpoint'
SnsEndpoint.setup do |config|
  config.topics_list = ['first_topic', 'second_topic'] #list of topics that endpoint should respond to subscription request
  config.subscribe_proc = Proc.new { |message| p message } #proc that should be executed when subscribe request got received and responded to, passed argument is message (json object)
  config.message_proc = Proc.new { |message| p message } #proc that should be executed when message got send to endpoint
end
SnsEndpoint::Core.run!

Contributing

  • Fork it
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Added some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create new Pull Request

FAQs

Package last updated on 24 Jun 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

OSZAR »