Created
March 12, 2021 18:18
-
-
Save taufiqibrahim/261a768289e7d35e3a4057bca726f9f2 to your computer and use it in GitHub Desktop.
Data Pipeline Service Graph Using AWS Neptune - Graphexp graphioGremlin.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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