Commit e0b444e5 authored by Dan Abramov's avatar Dan Abramov Committed by GitHub
Browse files

Gracefully shut down the server on signals (#2246)

parent 4a321713
3 merge requests!12191Lim.Pisey.168:/Identified - We are currently investigating reports of missing build logs. The issue has been identified and a resolution is in progress. We will provide a further update when available.Mar 21, 09:02 UTC,!12853brikk,!5717Automatically extract project file structure from build bundle file
Showing with 8 additions and 0 deletions
+8 -0
......@@ -84,6 +84,14 @@ choosePort(HOST, DEFAULT_PORT)
console.log(chalk.cyan('Starting the development server...\n'));
openBrowser(urls.localUrlForBrowser);
});
['SIGINT', 'SIGTERM'].forEach(function(sig) {
process.on(sig, function() {
console.log(`Gracefully shutting down server after ${sig}...`);
server.close();
process.exit();
});
});
})
.catch(err => {
if (err && err.message) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment