2019-08-19 01:19:40 +05:30
|
|
|
const isDev = process.env.FREECODECAMP_NODE_ENV !== 'production';
|
2017-04-27 01:54:56 +05:30
|
|
|
const isBeta = !!process.env.BETA;
|
|
|
|
|
|
|
|
export function getEmailSender() {
|
2017-09-17 14:54:48 +05:30
|
|
|
return process.env.SES_MAIL_FROM || 'team@freecodecamp.org';
|
2017-04-27 01:54:56 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
export function getPort() {
|
|
|
|
if (!isDev) {
|
|
|
|
return '443';
|
|
|
|
}
|
|
|
|
return process.env.SYNC_PORT || '3000';
|
|
|
|
}
|
|
|
|
|
|
|
|
export function getProtocol() {
|
|
|
|
return isDev ? 'http' : 'https';
|
|
|
|
}
|
|
|
|
|
|
|
|
export function getHost() {
|
|
|
|
if (isDev) {
|
|
|
|
return process.env.HOST || 'localhost';
|
|
|
|
}
|
2018-07-27 13:42:46 +05:30
|
|
|
return isBeta ? 'beta.freecodecamp.org' : 'www.freecodecamp.org';
|
2017-04-27 01:54:56 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
export function getServerFullURL() {
|
|
|
|
if (!isDev) {
|
2019-02-18 19:32:49 +00:00
|
|
|
return getProtocol() + '://' + getHost();
|
2017-04-27 01:54:56 +05:30
|
|
|
}
|
2019-02-18 19:32:49 +00:00
|
|
|
return getProtocol() + '://' + getHost() + ':' + getPort();
|
2017-04-27 01:54:56 +05:30
|
|
|
}
|