Methods
Constants
PROXY_API_URL | = | "http://127.0.0.1:8212/api/messages" |
Class Public methods
# File lib/apphunk/proxy.rb, line 30 def process_response(result) if result.status == :ok if result.response.code == '201' return true else Apphunk::Logger.error "The Apphunkd-Proxy couldn't store the message: #{result.response.code} / #{result.response.body}" return false end else Apphunk::Logger.error "Connection Error: Could not get a response from local Apphunkd-Proxy in time" return false end end
# File lib/apphunk/proxy.rb, line 10 def send_message_to_apphunkd(message, options) if options[:environments] && options[:environment] && !options[:environments].include?(options[:environment]) return false end payload = prepare_payload(message, options) result = Apphunk::Remote.post(PROXY_API_URL, payload, 3) return process_response(result) end