2

I'm using grape for restful service. As I know, :resource will define a path in url. For example:

module Sample
  module V1
    module Order
      class GetCheckInListApi < ApplicationApi
        resource :check_in_list do
          get root: :data do
             # business code here
          end
        end
      end
    end
  end
end

The url for example, will be: localhost:8000/api/v1/check_in_list. I want the url should be: localhost:8000/api/v1/check_in/list. How can I do in Grape ?

Thanks

Trần Kim Dự
  • 5,872
  • 12
  • 55
  • 107

1 Answers1

1

Does the resource has to be a :check_in_list? You could change it to :chect_in and add a /list route:

class GetCheckInListApi < ApplicationApi
  resource :check_in do
    get '/list' do
       # business code here
    end
  end
end
maicher
  • 2,625
  • 2
  • 16
  • 27