Hi,
this is what my index.js looks like:
const neo4j = require('neo4j-driver').v1;
const driver = neo4j.driver("https://bolt.custom-endpoint.ca:443", neo4j.auth.basic("neo4j", "password123"));
/* https://bolt.custom-endpoint.ca:443 connects to the 0.0.0.0:7687 port inside
the docker container in which the neo4j db is running. The neo4j.conf has been changed
to accommodate non-local requests
*/
const session = driver.session();
const personName = 'Alice';
const resultPromise = session.run(
'CREATE (a:Person {name: $name}) RETURN a',
{name: personName}
);
resultPromise.then(result => {
session.close();
const singleRecord = result.records[0];
const node = singleRecord.get(0);
console.log(node.properties.name);
// on application exit:
driver.close();
});
when I run that I get the following error:
(node:561) UnhandledPromiseRejectionWarning: ReferenceError: Headers is not defined
at createHttpHeaders (/mnt/c/Users/name/Desktop/relationship-mapper/node_modules/neo4j-driver/lib/v1/internal/http/http-request-runner.js:181:17)
at sendRequest (/mnt/c/Users/name/Desktop/relationship-mapper/node_modules/neo4j-driver/lib/v1/internal/http/http-request-runner.js:162:16)
at HttpRequestRunner.beginTransaction (/mnt/c/Users/name/Desktop/relationship-mapper/node_modules/neo4j-driver/lib/v1/internal/http/http-request-runner.js:56:14)
at HttpSession.run (/mnt/c/Users/name/Desktop/relationship-mapper/node_modules/neo4j-driver/lib/v1/internal/http/http-session.js:80:34)
at Object.<anonymous> (/mnt/c/Users/name/Desktop/relationship-mapper/index.js:7:31)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
(node:561) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:561) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I know my bolt endpoint is working fine because when i connect to the neo4j browser console and make it use the bolt connection through the settings, everything works fine. 
I can login and make cypher queries successfully over the bolt connection through the browser console.
However the neo4j-driver example code doesn't seem to work. I am running the neo4j docker container on a server, hence the different url. The example works fine when I run the docker container locally (and change the url to bolt://localhost:7687).
Any ideas of what's going wrong? thanks!