2016-10-29 22:04:44 -04:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
import Alexa from 'alexa-app';
|
|
|
|
|
|
|
|
import handleLaunchIntent, {
|
|
|
|
handleFindMovieIntent,
|
|
|
|
handleAddMovieIntent,
|
2016-10-29 22:40:43 -04:00
|
|
|
handleAddMovieDateIntent,
|
2016-10-29 22:04:44 -04:00
|
|
|
handleYesIntent,
|
|
|
|
handleNoIntent,
|
|
|
|
handleCancelIntent,
|
|
|
|
handleHelpIntent
|
|
|
|
} from './handlers.js';
|
|
|
|
|
|
|
|
const app = new Alexa.app('couchPotato');
|
|
|
|
|
|
|
|
app.launch(handleLaunchIntent);
|
|
|
|
app.intent('FindMovie', handleFindMovieIntent);
|
|
|
|
app.intent('AddMovie', handleAddMovieIntent);
|
2016-10-29 22:40:43 -04:00
|
|
|
app.intent('AddMovieDate', handleAddMovieDateIntent);
|
2016-10-29 22:04:44 -04:00
|
|
|
app.intent('AMAZON.YesIntent', handleYesIntent);
|
|
|
|
app.intent('AMAZON.NoIntent', handleNoIntent);
|
|
|
|
app.intent('AMAZON.CancelIntent', handleCancelIntent);
|
|
|
|
app.intent('AMAZON.HelpIntent', handleHelpIntent);
|
|
|
|
|
|
|
|
app.post = function(request, response, type, exception) {
|
|
|
|
if (exception) {
|
|
|
|
// Always turn an exception into a successful response
|
|
|
|
response.clear().say('An error occured: ' + exception).send();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
export default app;
|