add live meeting in broadcast screen
This commit is contained in:
26
lib/daily.rb
Normal file
26
lib/daily.rb
Normal file
@@ -0,0 +1,26 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Daily
|
||||
include HTTParty
|
||||
base_uri 'api.daily.co/v1'
|
||||
|
||||
class << self
|
||||
def create_room
|
||||
response = post "#{base_uri}/rooms", headers: headers
|
||||
|
||||
if response.code != 200
|
||||
throw StandardError.new('Failed to create a room')
|
||||
end
|
||||
|
||||
response.parsed_response
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def headers
|
||||
{
|
||||
'Authorization': "Bearer #{ENV['DAILY_API_TOKEN']}"
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user