Open suchetaswabhav opened 5 years ago
Here you will have find the documentation for this code, http://niralar.com/building-an-alexa-skills-as-a-web-service-with-express-node-js-mongodb/ http://niralar.com/build-an-amazon-alexa-skill-with-aws-lambda-function-blueprints/
Thanks siva, i shall look into it. But i want the NodeJS code -
// Require Neo4j
var neo4j = require('neo4j-driver').v1;
var path = require('path');
var logger = require('morgan');
var express = require('express');
var router = express.Router();
// Create Driver
const driver = new neo4j.driver("bolt://localhost:11001", neo4j.auth.basic("neo4j", "ib1"));
var session = driver.session();
var request = require('request');
router.get('/nodesObj/:nodesObj', seekIntersection);
module.exports = router;
function seekIntersection(req, res) {
var cypherQuery;
console.log("INSIDE NODE JS CONTROLLER OF seekIntersection");
var requestOutput = JSON.parse(req.params.nodesObj);
console.log("BODY IS, req, requestOutput =", requestOutput)
var company = requestOutput.companyName;
var relationNode = requestOutput.relationObj;
var nodeValue = requestOutput.nodeValue1;
cypherQuery = "WITH [\""+ nodeValue +"\"] as names MATCH (p)-[:"+ relationNode+ "]-(m) WHERE p.name in names RETURN m "
console.log("seekIntersection, cypherQuery = ", cypherQuery)
session
.run(cypherQuery)
.then(function (result) {
result.records.forEach(function (record) {
console.log("record = ", record);
console.log("result = ", result)
});
res.send(result);
})
.catch(function (err) {
console.log("inside catch = " + err);
})
}
console.log("Inside seekIntersection-controller.js")
to be formulated into this code in the link -
https://github.com/sivasankars/alexa-skills-live-sports/blob/master/alexa/index.js
Can you please help.
Hi Siva,
Can you please tell how did you integrate this code as a webservice with alexa? Because this particular link - https://github.com/sivasankars/alexa-skills-live-sports/blob/master/alexa/index.js
seems to be your only code for alexa. How to run it ? I have my NodeJs code as this -
How do i integrate it in my alexa /index.js file