mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2026-01-20 20:01:25 +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
|
|
}
|