Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function closeServer(server, app) {
gracefulExit.init(server);
app.use(gracefulExit.middleware(app));
gracefulExit.gracefulExitHandler(app, server, {
exitProcess: false
});
}
export const createOrGetServer = () => {
if (!server) {
server = http.createServer(app);
expressGracefulExit.init(server);
}
return server;
};