* fix(api): decouple api from curriculum This reverts commit8f0e441644
and introduces the implementations from #40703. * fix(gitpod): add curriculum build to GitPod This reverts commit706d70f58d
and introduces implementations from #41234. * docs: update DevOps manual for api change (#41259) Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
44 lines
1.2 KiB
JavaScript
44 lines
1.2 KiB
JavaScript
const path = require('path');
|
|
require('dotenv').config({ path: path.resolve(__dirname, '../../.env') });
|
|
|
|
const nodemon = require('nodemon');
|
|
const SmeeClient = require('smee-client');
|
|
const createDebugger = require('debug');
|
|
|
|
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);
|
|
});
|