Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save taufiqibrahim/261a768289e7d35e3a4057bca726f9f2 to your computer and use it in GitHub Desktop.
Save taufiqibrahim/261a768289e7d35e3a4057bca726f9f2 to your computer and use it in GitHub Desktop.
Data Pipeline Service Graph Using AWS Neptune - Graphexp graphioGremlin.js
function send_to_server(gremlin_query,query_type,active_node,message, callback){
let server_address = $('#server_address').val();
let server_port = $('#server_port').val();
let COMMUNICATION_PROTOCOL = $('#server_protocol').val();
if (COMMUNICATION_PROTOCOL == 'REST'){
let server_url = "https://"+server_address+":"+server_port; // Changed from http to https
run_ajax_request(gremlin_query,server_url,query_type,active_node,message,callback);
}
else if (COMMUNICATION_PROTOCOL == 'websocket'){
let server_url = "wss://"+server_address+":"+server_port+"/gremlin" // Changed from ws to wss
run_websocket_request(gremlin_query,server_url,query_type,active_node,message,callback);
}
else {
console.log('Bad communication protocol. Check configuration file. Accept "REST" or "websocket" .')
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment