Files
freeCodeCamp/api-server/src/development-start.js
Oliver Eyton-Williams e118dda13a fix: order imports and remove circular dependencies (#41824)
* fix: remove circular dependency

redux depended on templates/Challenges/redux and vice versa.  This
meant that import order mattered and confusing bugs could arise.

(cherry picked from commit 7d67a4e70922bbb3051f2f9982dcc69e240d43dc)

* feat: require imports to be in alphabetical order

Import order generally does not matter, but there are edge cases
(circular  imports and css imports, for example) where changing order
changes behaviour

(cherry picked from commit b8d1393a91ec6e068caf8e8498a5c95df68c2b2c)

* chore: order imports

* fix: lift up challenge description + title comps

This brings the classic Show closer to the others as they
now all create the description and title components

* fix: remove donation-saga/index circular import

(cherry picked from commit 51a44ca668a700786d2744feffeae4fdba5fd207)

* refactor: extract action-types from settings

(cherry picked from commit 25e26124d691c84a0d0827d41dafb761c686fadd)

* fix: lint errors

* feat: prevent useless renames
2021-08-02 08:39:40 -05:00

44 lines
1.2 KiB
JavaScript

const path = require('path');
require('dotenv').config({ path: path.resolve(__dirname, '../../.env') });
const createDebugger = require('debug');
const nodemon = require('nodemon');
const SmeeClient = require('smee-client');
const log = createDebugger('fcc:start:development');
if (process.env.WEBHOOK_PROXY_URL) {
const paypalPayloadHandler = new SmeeClient({
source: process.env.WEBHOOK_PROXY_URL,
target: process.env.API_LOCATION + '/hooks/update-paypal',
logger: { info: log, error: log }
});
const paypalevents = paypalPayloadHandler.start();
process.on('exit', () => {
log('Stopping webhook proxy client.');
paypalevents.close(() => {
log('Webhook proxy client is stopped.');
});
});
} else {
log('Webhook client is not configured.');
log('This can be ignored when not working with webhooks locally.');
}
nodemon({
ext: 'js json',
// --silent squashes an ELIFECYCLE error when the server exits
exec: 'npm run --silent babel-dev-server',
watch: path.resolve(__dirname, './server'),
spawn: true,
env: {
DEBUG: 'fcc*'
}
});
nodemon.on('restart', function nodemonRestart(files) {
log('App restarted due to: ', files);
});