Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exports.handler = function(event, context, callback) {
var DriverRemoteConnection = gremlin.driver.DriverRemoteConnection;
var Graph = gremlin.structure.Graph;
//Use wss:// for secure connections. See https://docs.aws.amazon.com/neptune/latest/userguide/access-graph-ssl.html
dc = new DriverRemoteConnection('wss://'+process.env.NEPTUNE_CLUSTER_ENDPOINT+':'+process.env.NEPTUNE_PORT+'/gremlin');
var graph = new Graph();
var g = graph.traversal().withRemote(dc);
const headers = {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'OPTIONS, POST, GET',
'Access-Control-Max-Age': 2592000, // 30 days
/** add other headers as per requirement */
'Access-Control-Allow-Headers' : '*',
"Content-Type": "application/json"
};
console.log("Path Parameters => "+ event.pathParameters);
console.log("event.pathParameters.proxy => "+ event.pathParameters.proxy);