travis-api/lib/travis/api/app/endpoint/home.rb
2012-07-27 15:55:57 +02:00

16 lines
376 B
Ruby

require 'travis/api/app'
class Travis::Api::App
class Endpoint
class Home < Endpoint
set(:prefix, '/')
# Landing point. Redirects web browsers to [API documentation](#/docs/).
get '/' do
redirect to('/docs/') if request.preferred_type('application/json', 'text/html') == 'text/html'
{ 'hello' => 'world' }
end
end
end
end