У меня есть навык hello world alexa, написанный на node js и развернутый в heroku. Мне нужно использовать веб-сокеты для отправки ответа на веб-интерфейс (например, страницу html на моем локальном компьютере). Возможно ли это?
мой сервер code-server.js
'use strict';
var AlexaAppServer = require( 'alexa-app-server' );
var server = new AlexaAppServer( {
httpsEnabled: false,
port: 8080
} );
server.start();
ниже 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;