source: trip-planner-front/node_modules/webpack-dev-server/lib/utils/setupExitSignals.js@ 6c1585f

Last change on this file since 6c1585f was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 486 bytes
Line 
1'use strict';
2
3const signals = ['SIGINT', 'SIGTERM'];
4
5function setupExitSignals(serverData) {
6 signals.forEach((signal) => {
7 process.on(signal, () => {
8 if (serverData && serverData.server) {
9 serverData.server.close(() => {
10 // eslint-disable-next-line no-process-exit
11 process.exit();
12 });
13 } else {
14 // eslint-disable-next-line no-process-exit
15 process.exit();
16 }
17 });
18 });
19}
20
21module.exports = setupExitSignals;
Note: See TracBrowser for help on using the repository browser.