Sha256: 48d1383ebb8bb1f68839c2041c0a33578ee1ea6728a9f8cdfcc04ef2243047fe

Contents?: true

Size: 642 Bytes

Versions: 14

Compression:

Stored size: 642 Bytes

Contents

require 'sinatra/base'

module Voom
  module Presenters
    module Demo
      # Echo's back post, delete and put
      # Used to demonstrate how the posts(updates), deletes and modifies actions work.
      class Echo < Sinatra::Base
        post('/_echo_') do
          content_type :json
          JSON.dump(params)
        end

        delete('/_echo_') do
          content_type :json
          JSON.dump(params)
        end

        put('/_echo_') do
          content_type :json
          JSON.dump(params)
        end

        # start the server if ruby file executed directly
        run! if app_file == $0
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
voom-presenters-0.1.13 lib/voom/presenters/demo/echo.rb
voom-presenters-0.1.12 lib/voom/presenters/demo/echo.rb
voom-presenters-0.1.11 lib/voom/presenters/demo/echo.rb
voom-presenters-0.1.10 lib/voom/presenters/demo/echo.rb
voom-presenters-0.1.9 lib/voom/presenters/demo/echo.rb
voom-presenters-0.1.8 lib/voom/presenters/demo/echo.rb
voom-presenters-0.1.7 lib/voom/presenters/demo/echo.rb
voom-presenters-0.1.6 lib/voom/presenters/demo/echo.rb
voom-presenters-0.1.5 lib/voom/presenters/demo/echo.rb
voom-presenters-0.1.4 lib/voom/presenters/demo/echo.rb
voom-presenters-0.1.3 lib/voom/presenters/demo/echo.rb
voom-presenters-0.1.2 lib/voom/presenters/demo/echo.rb
voom-presenters-0.1.1 lib/voom/presenters/demo/echo.rb
voom-presenters-0.1.0 lib/voom/presenters/demo/echo.rb