aboutsummaryrefslogtreecommitdiff
path: root/src/server/database.ts
diff options
context:
space:
mode:
authorlaurawilsonri <laura_wilson@brown.edu>2019-02-24 17:40:47 -0500
committerlaurawilsonri <laura_wilson@brown.edu>2019-02-24 17:40:47 -0500
commit03b35e3d6346800821bb830a7c102dede74647fe (patch)
tree47c8587c828f9f59e79b127d070728fc2a9f418a /src/server/database.ts
parentf7b46167a7fd5d7ecf560dbd72e7d3295ba6c0c9 (diff)
Got it compiling
Diffstat (limited to 'src/server/database.ts')
-rw-r--r--src/server/database.ts11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/server/database.ts b/src/server/database.ts
index 07c5819ab..dbf335c0a 100644
--- a/src/server/database.ts
+++ b/src/server/database.ts
@@ -1,6 +1,6 @@
import { action, configure } from 'mobx';
-import * as mongodb from 'mongodb';
-import { ObjectID } from 'mongodb';
+import * as mongodb from "mongodb"
+import { ObjectID } from "mongodb"
import { Transferable } from './Message';
import { Utils } from '../Utils';
@@ -8,10 +8,15 @@ export class Database {
public static Instance = new Database()
private MongoClient = mongodb.MongoClient;
private url = 'mongodb://localhost:27017/Dash';
+
private db?: mongodb.Db;
constructor() {
this.MongoClient.connect(this.url, (err, client) => {
+ if (err) {
+ console.log(err.message);
+ throw err;
+ }
this.db = client.db()
})
}
@@ -78,4 +83,4 @@ export class Database {
public print() {
console.log("db says hi!")
}
-}
+} \ No newline at end of file