17 lines
458 B
Ruby
17 lines
458 B
Ruby
require 'travis/api/app'
|
|
|
|
class Travis::Api::App
|
|
# Superclass for HTTP endpoints. Takes care of prefixing.
|
|
class Endpoint < Responder
|
|
set(:prefix) { "/" << name[/[^:]+$/].underscore }
|
|
before { content_type :json }
|
|
|
|
error(ActiveRecord::RecordNotFound, Sinatra::NotFound) { not_found }
|
|
not_found { content_type =~ /json/ ? { 'file' => 'not found' } : 'file not found' }
|
|
|
|
# TODO: Dummy method.
|
|
def self.scope(name)
|
|
end
|
|
end
|
|
end
|