aboutsummaryrefslogtreecommitdiff
path: root/src/server/database.ts
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2019-10-15 12:54:57 -0400
committerSam Wilkins <samwilkins333@gmail.com>2019-10-15 12:54:57 -0400
commit91e4ac65e0b8d1ff5c17ea0e80666038281ec5a6 (patch)
tree26efeddb65ac4a0d333d1decbf05335c310e72ad /src/server/database.ts
parentcc84f5620b3f3ef801e3b0696f817e4fb74f58fc (diff)
initial commit
Diffstat (limited to 'src/server/database.ts')
-rw-r--r--src/server/database.ts7
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());
});