mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2026-02-06 09:55:50 +00:00
In order to create the indices programmatically we need to change the default password for security concerns. To create the user we need to start the neo4j database. So I decided to provide a bash script that let us do it once the container are started. In production we must change the NEO4J_PASSWORD.
21 lines
418 B
JavaScript
21 lines
418 B
JavaScript
import { v1 as neo4j } from 'neo4j-driver'
|
|
|
|
let driver
|
|
|
|
export default function () {
|
|
return {
|
|
getDriver () {
|
|
if (!driver) {
|
|
driver = neo4j.driver(
|
|
process.env.NEO4J_URI || 'bolt://localhost:7687',
|
|
neo4j.auth.basic(
|
|
process.env.NEO4J_USERNAME || 'neo4j',
|
|
process.env.NEO4J_PASSWORD || 'neo4j'
|
|
)
|
|
)
|
|
}
|
|
return driver
|
|
}
|
|
}
|
|
}
|