-
Notifications
You must be signed in to change notification settings - Fork 0
/
database.js
59 lines (55 loc) · 1.21 KB
/
database.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
const bcrypt = require('bcryptjs');
/**
* @type {{[key: string]: {longUrl: string, userId: string, count: number, uniqueVisitors: string[], allVisits: {visitorId: string, timestamp: Date}[]}}}
*/
const urlDatabase = {
"b2xVn2": {
longUrl: "http://www.lighthouselabs.ca",
userId: "aJ48lW",
count: 0,
uniqueVisitors: [],
allVisits: []
},
"9sm5xK": {
longUrl: "http://www.google.com",
userId: "aJ48lW",
count: 0,
uniqueVisitors: [],
allVisits: []
},
b6UTxQ: {
longUrl: "https://www.tsn.ca",
userId: "test",
count: 0,
uniqueVisitors: [],
allVisits: []
},
i3BoGr: {
longUrl: "https://www.google.ca",
userId: "test",
count: 0,
uniqueVisitors: [],
allVisits: []
},
};
/**
* @type {Object<string, {id: string, email: string, password: string}}
*/
const usersDatabase = {
userRandomID: {
id: "userRandomID",
email: "[email protected]",
password: "purple-monkey-dinosaur",
},
aJ48lW: {
id: "aJ48lW",
email: "[email protected]",
password: "dishwasher-funk",
},
test: {
id: "test",
email: "[email protected]",
password: bcrypt.hashSync("test", 10),
},
};
module.exports = { usersDatabase, urlDatabase };