Files
freeCodeCamp/api-server/src/development-start.js
2024-04-29 07:49:21 +02:00

22 lines
593 B
JavaScript

const path = require('path');
require('dotenv').config({ path: path.resolve(__dirname, '../../.env') });
const createDebugger = require('debug');
const nodemon = require('nodemon');
const log = createDebugger('fcc:start:development');
nodemon({
ext: 'js json',
// --silent squashes an ELIFECYCLE error when the server exits
exec: 'pnpm run --silent babel-dev-server',
watch: path.resolve(__dirname, './server'),
spawn: true,
env: {
DEBUG: `fcc*,${process.env.DEBUG}`
}
});
nodemon.on('restart', function nodemonRestart(files) {
log('App restarted due to: ', files);
});