mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2026-01-18 02:41:23 +00:00
17 lines
367 B
JavaScript
17 lines
367 B
JavaScript
import { v1 as neo4j } from 'neo4j-driver'
|
|
import CONFIG from './../config'
|
|
|
|
let driver
|
|
|
|
export function getDriver(options = {}) {
|
|
const {
|
|
uri = CONFIG.NEO4J_URI,
|
|
username = CONFIG.NEO4J_USERNAME,
|
|
password = CONFIG.NEO4J_PASSWORD,
|
|
} = options
|
|
if (!driver) {
|
|
driver = neo4j.driver(uri, neo4j.auth.basic(username, password))
|
|
}
|
|
return driver
|
|
}
|