Sha256: 0bfe4c2f5598606115cb0c4320f8f8ebf2f768c54e7cc42d537fc325e321a91b

Contents?: true

Size: 1.24 KB

Versions: 25

Compression:

Stored size: 1.24 KB

Contents

#
# Copyright 2011 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

module Backstage
  class Application < Sinatra::Base
    resource :app

    get "/app/:name/logs" do
      @parent = App.find( Util.decode_name( params[:name] ) )
      @collection = @parent.logs
      if html_requested?
        haml :'logs/index'
      else
        content_type :json
        collection_to_json( @collection )
      end
    end

     get "/app/:name/log/:id" do
      @parent = App.find( Util.decode_name( params[:name] ) )
      @object = Log.find( Util.decode_name( params[:id] ) )
      @object.parent = @parent
                          
      if html_requested?
        haml :'logs/show'
      else
        object_to_json( @object )
      end
    end

  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
torquebox-backstage-1.1.2 lib/apps/routes.rb
torquebox-backstage-1.1.1 lib/apps/routes.rb
torquebox-backstage-1.1.0 lib/apps/routes.rb
torquebox-backstage-1.0.7 lib/apps/routes.rb
torquebox-backstage-1.0.6 lib/apps/routes.rb
torquebox-backstage-1.0.5 lib/apps/routes.rb
torquebox-backstage-1.0.4 lib/apps/routes.rb
torquebox-backstage-1.0.3 lib/apps/routes.rb
torquebox-backstage-1.0.2 lib/apps/routes.rb
torquebox-backstage-1.0.1 lib/apps/routes.rb
torquebox-backstage-1.0.0 lib/apps/routes.rb
torquebox-backstage-1.0.0.beta2 lib/apps/routes.rb
torquebox-backstage-1.0.0.beta1 lib/apps/routes.rb
torquebox-backstage-0.5.4 lib/apps/routes.rb
torquebox-backstage-0.5.3 lib/apps/routes.rb
torquebox-backstage-0.5.2 lib/apps/routes.rb
torquebox-backstage-0.5.1 lib/apps/routes.rb
torquebox-backstage-0.5 lib/apps/routes.rb
torquebox-backstage-0.4.3 lib/apps/routes.rb
torquebox-backstage-0.4.2 lib/apps/routes.rb