-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinitdb.js
More file actions
27 lines (26 loc) · 746 Bytes
/
initdb.js
File metadata and controls
27 lines (26 loc) · 746 Bytes
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
const mongoose = require("mongoose");
const configjson = require("./config.json");
// Models.
const Config = require("./models/config");
mongoose.connect(
"mongodb://" +
configjson.db.user +
":" +
configjson.db.pass +
"@" +
"localhost/nogiveaway",
function (err) {
if (err) throw err;
//Save config and blacklist stuff to db
const configtosave = new Config({
_id: new mongoose.Types.ObjectId(),
blacklistedavatars: configjson.blacklistedavatars,
blacklistedids: configjson.blacklistedids,
token: configjson.token,
blacklistednames: configjson.blacklistednames,
whitelistedids: configjson.whitelistedids,
});
configtosave.save();
},
{ useNewUrlParser: true }
);