More preparations for 2 factor authentication
This commit is contained in:
@ -1,3 +1,11 @@
|
||||
import SafeMongo from "@hibas123/safe_mongo";
|
||||
const DB = new SafeMongo("mongodb://localhost", "openauth");
|
||||
import Config from "./config"
|
||||
let dbname = "openauth"
|
||||
let host = "localhost"
|
||||
if (Config.database) {
|
||||
if (Config.database.database) dbname = Config.database.database;
|
||||
if (Config.database.host) host = Config.database.host;
|
||||
}
|
||||
if (Config.dev) dbname += "_dev";
|
||||
const DB = new SafeMongo("mongodb://" + host, dbname);
|
||||
export default DB;
|
Reference in New Issue
Block a user