diff options
author | madelinegr <laura_wilson@brown.edu> | 2019-02-14 02:47:28 -0500 |
---|---|---|
committer | madelinegr <laura_wilson@brown.edu> | 2019-02-14 02:47:28 -0500 |
commit | ddd503f21dc4b3368d80b4be475817cd9a13fcd1 (patch) | |
tree | 5a235f3405fb3c5e1c7bb9db852ef73ddbfb2b75 /src/server/authentication/models/User.ts | |
parent | ff25c29c6801b1858ce6cd15a5735dba1fc67e8c (diff) |
getting there?
Diffstat (limited to 'src/server/authentication/models/User.ts')
-rw-r--r-- | src/server/authentication/models/User.ts | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/server/authentication/models/User.ts b/src/server/authentication/models/User.ts index 9f58d317d..9752c4260 100644 --- a/src/server/authentication/models/User.ts +++ b/src/server/authentication/models/User.ts @@ -1,7 +1,21 @@ +//@ts-ignore import * as bcrypt from "bcrypt-nodejs"; import * as crypto from "crypto"; +//@ts-ignore import * as mongoose from "mongoose"; +var url = 'mongodb://localhost:27017/Dash' +mongoose.connect(url, { useNewUrlParser: true }); + +mongoose.connection.on('connected', function () { + console.log('Stablished connection on ' + url); +}); +mongoose.connection.on('error', function (error) { + console.log('Something wrong happened: ' + error); +}); +mongoose.connection.on('disconnected', function () { + console.log('connection closed'); +}); export type UserModel = mongoose.Document & { email: string, password: string, @@ -18,7 +32,6 @@ export type UserModel = mongoose.Document & { }, comparePassword: comparePasswordFunction, - gravatar: (size: number) => string }; type comparePasswordFunction = (candidatePassword: string, cb: (err: any, isMatch: any) => {}) => void; |