aboutsummaryrefslogtreecommitdiff
path: root/src/server/database.ts
diff options
context:
space:
mode:
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());
});