Files
alexa-dev-excuse/app.rb
Tommy Parnell 5cf52bb138 init
2016-12-01 20:42:25 -05:00

24 lines
464 B
Ruby

require 'sinatra'
require 'alexa_skills_ruby'
class CustomHandler < AlexaSkillsRuby::Handler
on_intent("GetDeveloperExcuse") do
response.set_output_speech_text("Developer Excuses yo")
end
end
post '/' do
content_type :json
handler = CustomHandler.new(application_id: ENV['APPLICATION_ID'], logger: logger)
begin
handler.handle(request.body.read)
rescue AlexaSkillsRuby::InvalidApplicationId => e
logger.error e.to_s
403
end
end