Skip to content

Instantly share code, notes, and snippets.

@barsumek
Created November 22, 2018 11:01
Show Gist options
  • Save barsumek/8c1e06c43cac0b2d10c262c81f3cb775 to your computer and use it in GitHub Desktop.
Save barsumek/8c1e06c43cac0b2d10c262c81f3cb775 to your computer and use it in GitHub Desktop.
function stopHttpServer() {
return new Promise(resolve => httpServer.close(() => resolve()));
}
async function stopGraphQLServer() {
if (!httpServer) {
console.warn("Tried to close null HTTP server.");
return;
}
await stopHttpServer();
httpServer = null;
graphQLServerApp = null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment