Skip to content

Commit

Permalink
Merge pull request #35 from abetomo/add_callback_to_server_close
Browse files Browse the repository at this point in the history
Add callback to server close
  • Loading branch information
abetomo authored Mar 16, 2019
2 parents 3baa22b + 741506a commit 667217c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,11 @@ class SimplyImitatedSQSHttpServer {
return this.getUrl(port, host)
}

close () {
close (callback) {
if (this.server == null) return
this.sqs.clear()
return this.server.close(() => process.exit())
if (callback == null) callback = () => process.exit()
return this.server.close(callback)
}
}

Expand Down

0 comments on commit 667217c

Please sign in to comment.