Created
January 26, 2023 05:27
-
-
Save ZackDeRose/b5878895d9c31ce582955e065d4baf51 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function startBackendServer(options: ServeFullstackExecutorSchema) { | |
let frontendServerStarted = false; | |
return new Promise(() => { | |
const childProcess = exec(`npx nx serve ${options.backendProject}`, { | |
maxBuffer: LARGE_BUFFER, | |
}); | |
process.on('exit', () => childProcess.kill()); | |
process.on('SIGTERM', () => childProcess.kill()); | |
childProcess.stdout.on('data', (data) => { | |
if (!frontendServerStarted && data.includes('No errors found.')) { | |
startFrontendServer(options.frontendProject, targetPadSize); | |
frontendServerStarted = true; | |
} | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment