I have an hello world alexa skill written in node js and deployed it in heroku. I have to use websockets to send the response to a web ui(say a html page in my local machine).Is this possible?
my server code-server.js
'use strict';
var AlexaAppServer = require( 'alexa-app-server' );
var server = new AlexaAppServer( {
httpsEnabled: false,
port: 8080
} );
server.start();
below is index.js
module.change_code = 1;
'use strict';
var alexa = require( 'alexa-app' );
var app = new alexa.app('Helloworld');
app.launch( function( request, response ) {
console.log(app);
//console.log(request);
response.say( 'Welcome to Welcome to helloworld.' );
});
app.error = function( exception, request, response ) {
console.log(exception)
console.log(request);
console.log(response);
response.say( 'Sorry an error occured ' + error.message);
};
app.intent('Helloworld',
{
"slots":[]
,"utterances":[
"hello alexa",
"hi alexa",
"how are you?"]
},
function(request,response) {
response.say("welcome user");
//send this same response to a webpage using socket
}
);
module.exports = app;