This commit is contained in:
Tommy Parnell
2016-12-01 20:42:25 -05:00
commit 5cf52bb138
2 changed files with 25 additions and 0 deletions

1
Gemfile Normal file
View File

@@ -0,0 +1 @@
gem 'alexa_skills_ruby'

24
app.rb Normal file
View File

@@ -0,0 +1,24 @@
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