Sha256: 6f948b48e464e8d64207ae77046920ba689e6d850a4e6af76469fb4fdfc7d5cd
Contents?: true
Size: 651 Bytes
Versions: 26
Compression:
Stored size: 651 Bytes
Contents
module Cuboid module Rest class Server module Routes module Agent def self.registered( app ) app.get '/agent/url' do ensure_agent! json Options.agent.url end app.put '/agent/url' do url = ::JSON.load( request.body.read ) || {} handle_error do connect_to_agent( url ).alive? @agent = nil Options.agent.url = url json nil end end app.delete '/agent/url' do ensure_agent! json @agent = Options.agent.url = nil end end end end end end end
Version data entries
26 entries across 26 versions & 1 rubygems