diff options
author | Sam Wilkins <samwilkins333@gmail.com> | 2019-10-15 12:54:57 -0400 |
---|---|---|
committer | Sam Wilkins <samwilkins333@gmail.com> | 2019-10-15 12:54:57 -0400 |
commit | 91e4ac65e0b8d1ff5c17ea0e80666038281ec5a6 (patch) | |
tree | 26efeddb65ac4a0d333d1decbf05335c310e72ad /src/server/database.ts | |
parent | cc84f5620b3f3ef801e3b0696f817e4fb74f58fc (diff) |
initial commit
Diffstat (limited to 'src/server/database.ts')
-rw-r--r-- | src/server/database.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/server/database.ts b/src/server/database.ts index db86b472d..25e1e67e0 100644 --- a/src/server/database.ts +++ b/src/server/database.ts @@ -8,16 +8,19 @@ import { GoogleApiServerUtils } from './apis/google/GoogleApiServerUtils'; export namespace Database { + const schema = 'Dash'; + const port = 27017; + export const url = `mongodb://localhost:${port}/${schema}`; + class Database { public static DocumentsCollection = 'documents'; private MongoClient = mongodb.MongoClient; - private url = 'mongodb://localhost:27017/Dash'; private currentWrites: { [id: string]: Promise<void> } = {}; private db?: mongodb.Db; private onConnect: (() => void)[] = []; constructor() { - this.MongoClient.connect(this.url, (err, client) => { + this.MongoClient.connect(url, (_err, client) => { this.db = client.db(); this.onConnect.forEach(fn => fn()); }); |