api.rb 439 Bytes
Newer Older
1
Dir["#{Rails.root}/lib/api/*.rb"].each {|file| require file}
Nihad Abbasov's avatar
Nihad Abbasov committed
2 3 4

module Gitlab
  class API < Grape::API
Nihad Abbasov's avatar
Nihad Abbasov committed
5
    VERSION = 'v2'
6
    version VERSION, using: :path
Nihad Abbasov's avatar
Nihad Abbasov committed
7

8 9 10 11
    rescue_from ActiveRecord::RecordNotFound do
      rack_response({'message' => '404 Not found'}.to_json, 404)
    end

Nihad Abbasov's avatar
Nihad Abbasov committed
12
    format :json
Nihad Abbasov's avatar
Nihad Abbasov committed
13
    error_format :json
Nihad Abbasov's avatar
Nihad Abbasov committed
14 15
    helpers APIHelpers

16 17
    mount Users
    mount Projects
Nihad Abbasov's avatar
Nihad Abbasov committed
18
    mount Issues
Robert Speicher's avatar
Robert Speicher committed
19
    mount Milestones
Alex Denisov's avatar
Alex Denisov committed
20
    mount Keys
Nihad Abbasov's avatar
Nihad Abbasov committed
21
  end
22
end