mirror of
https://github.com/maciejpedzich/six-degs-of-f1.git
synced 2024-11-27 15:55:47 +01:00
Create a global Neo4j connection instance
This commit is contained in:
parent
88793ee58d
commit
f158026ecd
6
src/db.ts
Normal file
6
src/db.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import { auth, driver } from 'neo4j-driver';
|
||||
|
||||
export const db = driver(
|
||||
import.meta.env.NEO4J_DB_URI,
|
||||
auth.basic(import.meta.env.NEO4J_USERNAME, import.meta.env.NEO4J_PASSWORD)
|
||||
);
|
11
src/env.d.ts
vendored
11
src/env.d.ts
vendored
@ -1 +1,12 @@
|
||||
/// <reference path="../.astro/types.d.ts" />
|
||||
/// <reference types="astro/client" />
|
||||
|
||||
interface ImportMetaEnv {
|
||||
readonly NEO4J_DB_URI: string;
|
||||
readonly NEO4J_USERNAME: string;
|
||||
readonly NEO4J_PASSWORD: string;
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
readonly env: ImportMetaEnv;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user