Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
01-25-2021 03:43 AM
Hello everybody:)
I would want to know if the option of connect to neo4j from javascript enable also for free using?
I try it and its not work for me.
Some one can help?
var express = require('express');
var path=require('path');
var logger = require('morgan');
var bodyparser = require('body-parser');
var neo4j = require('neo4j-driver');
var app = express();
app.set('views', path.join(__dirname, 'views'));
app.set('views engine', 'ejs');
app.use(logger('dev'));
app.use(bodyparser.json());
app.use(bodyparser.urlencoded({extended:false}));
app.use(express.static(path.join(__dirname, 'public')));
const uri = 'bolt://localhost:7687'
const driver = neo4j.driver(uri, neo4j.auth.basic('neo4j', 'neo4j'));
var session = driver.session();
app.get('/', function(req, res){
session
.run('MATCH(n:Movie) return n LIMIT 25')
.then(function(result){result.records.foreach(function(record){
console.log(record);
alert(record);
});
})
.catch(function(err){
console.log(err);
})
res.send('It Works');
})
app.listen(3000);
console.log('server');
module.exports=app;
I get this error message:
Thank you a lot:)
01-25-2021 06:00 AM
the error simply reports that the connection as failed as a result of incorrect authentication. Given your code it appears you are attempting to connect to the local instance of Neo4j over port :7687 and with a username/password or 'neo4j/neo4j'.
As the Neo4j Browser, i.e. http://localhost:7474, is a Javascript built application, have you confirmed you can login using these same credentials?
01-25-2021 06:36 AM
No, How can I do it?
01-25-2021 06:56 AM
????
Is Neo4j running?
Does http://localhost:7474 result in a 404 error ? Does it present you a UI to enter username/password?
01-25-2021 07:00 AM
neo4j running.
how do i confirmed login using these same credentials?
01-25-2021 07:40 AM
If you launch a browser ( i.e Google Chrome, Mozilla Firefox, Apple Safari ) and enter a URL of http://localhost:7474 you should be prompted for username/password
01-25-2021 01:19 PM
can I lunch on bolt server? I see that my project run on colt server.
like this:
const uri = 'bolt://localhost:7687';
const driver = neo4j.driver(uri, neo4j.auth.basic('neo4j', 'neo4j'));
This also not work for me but I want to know if it is legal.
Thanks
01-25-2021 03:00 PM
Correct. bolt:// is typically on port 7687 whereas http:// is typically on :7474
All the sessions of the conference are now available online