Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
24 lines (19 sloc) 561 Bytes
require 'apps/base_app'
require 'endpoint_models/users/user'
require 'endpoint_models/users/user_by_id'
module Apps
class Users < CaravanBase
user_versions = {
'1.0' => EndpointModels::UserV10,
'2.0' => EndpointModels::User
}
# RestClient.get 'https://server.com/users/ceaess'
get '/:username' do
endpoint = user_versions.fetch(get_preferred_version('2.0', '1.0'))
respond_with endpoint.data_for(params)
end
get '/by-id/:id' do
respond_with EndpointModels::UserById.data_for(params)
end
end
end
You can’t perform that action at this time.