node-neo4j icon indicating copy to clipboard operation
node-neo4j copied to clipboard

Cross-Origin Resource Sharing (CORS) support

Open flip111 opened this issue 10 years ago • 0 comments

I was trying to browserify this package so can quickly prototype some client side app without having to setup a server (apart from neo4j itself). Looking at these stackoverflow comments there is a problem with the neo4j server with the old cypher endpoint but everything should work fine with the transactional endpoint.

http://stackoverflow.com/a/26976950/1833322 http://stackoverflow.com/a/26686262/1833322 (comment)

so i just tried

var db = new neo4j('http://neo4j:neo4j@localhost:7474');
db.beginTransaction();

as i was guessing the beginTransaction function would do something with the transactional endpoint. But i'm still getting the CORS error:

XMLHttpRequest cannot load http://localhost:7474/db/data/transaction. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access. The response had HTTP status code 401.

flip111 avatar Oct 21 '15 23:10 flip111