1
Backend/.dockerignore
Normal file
1
Backend/.dockerignore
Normal file
@ -0,0 +1 @@
|
||||
config.ini
|
@ -10,6 +10,8 @@ dotenv.config();
|
||||
export interface DatabaseConfig {
|
||||
host: string;
|
||||
database: string;
|
||||
username?: string;
|
||||
password?: string;
|
||||
}
|
||||
|
||||
export interface WebConfig {
|
||||
@ -57,6 +59,14 @@ const config = (parse(
|
||||
type: String,
|
||||
default: "localhost",
|
||||
},
|
||||
username: {
|
||||
type: String,
|
||||
optional: true,
|
||||
},
|
||||
password: {
|
||||
type: String,
|
||||
optional: true,
|
||||
},
|
||||
},
|
||||
web: {
|
||||
port: {
|
||||
|
@ -7,7 +7,16 @@ if (Config.database) {
|
||||
if (Config.database.host) host = Config.database.host;
|
||||
}
|
||||
if (Config.core.dev) dbname += "_dev";
|
||||
const DB = new SafeMongo("mongodb://" + host, dbname, {
|
||||
|
||||
let auth = undefined;
|
||||
if (Config.database.username) {
|
||||
auth = {
|
||||
username: Config.database.username,
|
||||
password: Config.database.password
|
||||
}
|
||||
}
|
||||
|
||||
const DB = new SafeMongo("mongodb://" + host, dbname, {
|
||||
auth
|
||||
});
|
||||
export default DB;
|
||||
|
Reference in New Issue
Block a user