fix: NODE_ENV conflicts on pipelines
This commit is contained in:
committed by
mrugesh
parent
d864326d97
commit
ac50216949
@ -144,7 +144,7 @@ export default function donateBoot(app, done) {
|
||||
const publicInvalid = !pubKey || pubKey === 'pk_from_stipe_dashboard';
|
||||
|
||||
if (secretInvalid || publicInvalid) {
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
if (process.env.FREECODECAMP_NODE_ENV === 'production') {
|
||||
throw new Error('Stripe API keys are required to boot the server!');
|
||||
}
|
||||
console.info('No Stripe API keys were found, moving on...');
|
||||
|
@ -3,7 +3,7 @@ const createDebugger = require('debug');
|
||||
const log = createDebugger('fcc:boot:explorer');
|
||||
|
||||
module.exports = function mountLoopBackExplorer(app) {
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
if (process.env.FREECODECAMP_NODE_ENV === 'production') {
|
||||
return;
|
||||
}
|
||||
let explorer;
|
||||
|
@ -12,7 +12,7 @@ let trusted = [
|
||||
const host = process.env.HOST || 'localhost';
|
||||
const port = process.env.SYNC_PORT || '3000';
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
if (process.env.FREECODECAMP_NODE_ENV !== 'production') {
|
||||
trusted = trusted.concat([`ws://${host}:${port}`, 'http://localhost:8000']);
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@ import { homeLocation } from '../../../config/env';
|
||||
|
||||
import { unwrapHandledError } from '../utils/create-handled-error.js';
|
||||
|
||||
const isDev = process.env.NODE_ENV !== 'production';
|
||||
const isDev = process.env.FREECODECAMP_NODE_ENV !== 'production';
|
||||
|
||||
export default function prodErrorHandler() {
|
||||
// error handling in production.
|
||||
|
@ -27,13 +27,16 @@ ${JSON.stringify(error, null, 2)}
|
||||
};
|
||||
|
||||
export function reportError(err) {
|
||||
return process.env.NODE_ENV === 'production'
|
||||
return process.env.FREECODECAMP_NODE_ENV === 'production'
|
||||
? reporter.error(err.message, err)
|
||||
: console.error(err);
|
||||
}
|
||||
|
||||
export default function errrorReporter() {
|
||||
if (process.env.NODE_ENV !== 'production' && process.env.ERROR_REPORTER) {
|
||||
if (
|
||||
process.env.FREECODECAMP_NODE_ENV !== 'production' &&
|
||||
process.env.ERROR_REPORTER
|
||||
) {
|
||||
return (err, req, res, next) => {
|
||||
console.error(errTemplate(err, req));
|
||||
|
||||
|
@ -8,7 +8,7 @@ import {
|
||||
getFirstChallenge as _getFirstChallenge
|
||||
} from '../../common/utils/map.js';
|
||||
|
||||
const isDev = process.env.NODE_ENV !== 'production';
|
||||
const isDev = process.env.FREECODECAMP_NODE_ENV !== 'production';
|
||||
const isBeta = !!process.env.BETA;
|
||||
const challengesRegex = /^(bonfire|waypoint|zipline|basejump|checkpoint)/i;
|
||||
const addNameIdMap = _.once(_addNameIdToMap);
|
||||
|
@ -1,4 +1,4 @@
|
||||
const isDev = process.env.NODE_ENV !== 'production';
|
||||
const isDev = process.env.FREECODECAMP_NODE_ENV !== 'production';
|
||||
const isBeta = !!process.env.BETA;
|
||||
|
||||
export function getEmailSender() {
|
||||
|
Reference in New Issue
Block a user