From 529212e6b9ef7b079c33308e79b96d755ce0b7c8 Mon Sep 17 00:00:00 2001 From: Walter Zalazar Date: Thu, 24 Jan 2019 15:49:59 -0300 Subject: [PATCH] fix: Server Stop (#43) --- index.js | 2 +- server.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 940c6471..d028007d 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,5 @@ import { server } from './server' server() - .then(server => process.on('SIGINT', () => server.stop())) + .then(() => process.on('SIGINT', () => process.exit(0)) .catch(e => console.log(e)) diff --git a/server.js b/server.js index 585bc801..70017311 100644 --- a/server.js +++ b/server.js @@ -32,8 +32,13 @@ export const server = async () => { return handle(req, res) }) + const stop = () => { + graphite.stop + if (dev) app.hotReloader.webpackDevMiddleware.close + } + return { - stop: graphite.stop + stop, } } catch(e) {