Change default database name + cleaner code

This commit is contained in:
Niko 2022-02-08 23:25:55 +01:00
parent 4abbcc690b
commit 93b7593151
1 changed files with 2 additions and 2 deletions

View File

@ -7,14 +7,14 @@ module.exports = {
if (mconn !== null)
return mconn
const dbhost = process.env.DB_HOST || 'db'
mconn = new MongoClient('mongodb://'+dbhost+':27017', {
mconn = new MongoClient(`mongodb://${dbhost}:27017`, {
useUnifiedTopology: true,
useNewUrlParser: true
})
return mconn
},
get: () => {
mdb = mconn.db(process.env.DB_NAME || 'activitypub')
mdb = mconn.db(process.env.DB_NAME || 'fedilove')
return mdb
},
table: {