mirror of
https://github.com/strapi/strapi.git
synced 2025-07-27 10:56:36 +00:00
27 lines
519 B
JavaScript
27 lines
519 B
JavaScript
![]() |
'use strict';
|
||
|
|
||
|
/**
|
||
|
* `Strapi.prototype.stop()`
|
||
|
*
|
||
|
* The inverse of `start()`, this method
|
||
|
* shuts down all attached servers.
|
||
|
*
|
||
|
* It also unbinds listeners and terminates child processes.
|
||
|
*
|
||
|
* @api public
|
||
|
*/
|
||
|
|
||
|
module.exports = function stop() {
|
||
|
const self = this;
|
||
|
|
||
|
// Flag `self._exiting` as soon as the application has begun to shutdown.
|
||
|
// This may be used by hooks and other parts of core.
|
||
|
self._exiting = true;
|
||
|
|
||
|
// Exit the REPL.
|
||
|
process.exit(0);
|
||
|
|
||
|
// Emit a `stop` event.
|
||
|
self.emit('stop');
|
||
|
};
|