minne ® API ”¹–„

  • View
    985

  • Download
    3

Embed Size (px)

Text of minne ® API ”¹–„

  • 1.

  • # Gemfile + gem 'log-analyzer' $ bundle exec rake log_analyzer:analyze method endpoint count response_time(avg) response_time(max) response_time(min) GET / 10 20.5 55 3 GET /users 5 10.3 30 3 GET /users/:id 3 10 15 5 POST /users 2 30 40 20 DELETE /users/:id 0

  • 2.

  • # routes.rb scope :v1 do resources :users, controller: 'v3/users' end scope :v3 do resources :users end

  • # routes.rb scope :v1 do resources :users, controller: 'v3/users' end

  • module RenderReplaceable def _prefixes request_version = request.path.match(/\/v[0-9]\//).to_s self.class._prefixes.map do |prefix| prefix.sub(/^api\/v[0-9]\//, "api#{request_version}") end end end