Newer
Older
FORESTIER Fabien
committed
import { config } from './config';
export class ConfigService {
private _config = config;
constructor() {
FORESTIER Fabien
committed
// Initializing conf with values from var env
this._config.smtpConfig.host = process.env.SMTP_HOST;
this._config.smtpConfig.port = process.env.SMTP_PORT;
Fabien Forestier
committed
if (process.env.SMTP_USER && process.env.SMTP_PASSWORD) {
this._config.smtpConfig = {
...this._config.smtpConfig,
auth: {
user: process.env.SMTP_USER,
pass: process.env.SMTP_PASSWORD,
},
Fabien Forestier
committed
};
}
this._config.mailSubjectPrefix = process.env.MAIL_SUBJECT_PREFIX;
FORESTIER Fabien
committed
this._config.userSupportMailbox = process.env.USER_SUPPORT_MAILBOX;
this._config.noReplyMailAddress = process.env.NO_REPLY_MAIL_ADDRESS;
Fabien Forestier
committed
this._config.additionalFeedbackEmails =
process.env.ADDITIONAL_FEEDBACK_EMAILS;
FORESTIER Fabien
committed
this._config.groupHeader = process.env.GROUP_HEADER;
this._config.groupNames.emailWriter = process.env.EMAIL_WRITER_GROUP_NAME;
this._config.imageHost = process.env.IMAGE_HOST;
FORESTIER Fabien
committed
}
get config() {
return this._config;
}