Sha256: 594f5539c3d22ad078f73557b308a07da4a637f99222b7d6fd07aaec0178a61c

Contents?: true

Size: 506 Bytes

Versions: 8

Compression:

Stored size: 506 Bytes

Contents

module Apphunkd
  module API

    class Service < Sinatra::Base
      set :sessions, false
      set :environment, DaemonKit.env.to_sym

      post '/api/messages' do
        if Apphunkd.queue.store(params)
          status 201
        else
          status 400
          "Body or Token missing."
        end
      end

      not_found do
        "Not found. The requested resources doesn't exist."
      end

      error do
        'Hoppla. Some internal stuff has crashed.'
      end
    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
apphunkd-0.13.0 lib/apphunkd/api/service.rb
apphunkd-0.12.2 lib/apphunkd/api/service.rb
apphunkd-0.12.1 lib/apphunkd/api/service.rb
apphunkd-0.12.0 lib/apphunkd/api/service.rb
apphunkd-0.11.1 lib/apphunkd/api/service.rb
apphunkd-0.11.0 lib/apphunkd/api/service.rb
apphunkd-0.10.1 lib/apphunkd/api/service.rb
apphunkd-0.10.0 lib/apphunkd/api/service.rb