Skip to content

Commit

Permalink
fix: Server Stop (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
wzalazar authored Jan 24, 2019
1 parent f5246c6 commit 529212e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -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))
7 changes: 6 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 529212e

Please sign in to comment.