summaryrefslogtreecommitdiff
path: root/lib/api.rb
blob: 3b62f31bf3227fc953fa99cbd92c3130f450c765 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Dir["#{Rails.root}/lib/api/*.rb"].each {|file| require file}

module Gitlab
  class API < Grape::API
    VERSION = 'v2'
    version VERSION, using: :path

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

    format :json
    error_format :json
    helpers APIHelpers

    mount Users
    mount Projects
    mount Issues
    mount Milestones
    mount Keys
    mount Session
  end
end