mirror of
https://github.com/internetee/registry.git
synced 2025-05-19 02:39:37 +02:00
Add basic REST API
This commit is contained in:
parent
b934850ba7
commit
dc2270491d
5 changed files with 53 additions and 0 deletions
22
app/api/repp/api.rb
Normal file
22
app/api/repp/api.rb
Normal file
|
@ -0,0 +1,22 @@
|
|||
module Repp
|
||||
class API < Grape::API
|
||||
format :json
|
||||
prefix :repp
|
||||
version 'v1', using: :path
|
||||
|
||||
http_basic do |username, password|
|
||||
@current_user ||= EppUser.find_by(username: username, password: password)
|
||||
end
|
||||
|
||||
helpers do
|
||||
attr_reader :current_user
|
||||
end
|
||||
|
||||
resource :domains do
|
||||
desc 'Return list of domains'
|
||||
get '/' do
|
||||
current_user.registrar.domains
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue