exit when complete

This commit is contained in:
AJ ONeal 2015-12-16 04:09:22 +00:00
parent 58e43b8199
commit 27092bdd7f
2 changed files with 9 additions and 1 deletions

View File

@ -15,6 +15,7 @@ var acmeDiscoveryUrl = LeCore.stagingServerUrl;
var challengeStore = require('./challenge-store'); var challengeStore = require('./challenge-store');
var certStore = require('./cert-store'); var certStore = require('./cert-store');
var serve = require('./serve'); var serve = require('./serve');
var closer;
var accountPrivateKeyPem = null; var accountPrivateKeyPem = null;
var domainPrivateKeyPem = null; var domainPrivateKeyPem = null;
@ -94,6 +95,7 @@ function runDemo() {
console.log('[certs]'); console.log('[certs]');
console.log(err || certs); console.log(err || certs);
closer();
}); });
@ -106,7 +108,7 @@ function runDemo() {
// //
// Setup the Server // Setup the Server
// //
serve.init({ closer = serve.init({
LeCore: LeCore LeCore: LeCore
// needs a default key and cert chain, anything will do // needs a default key and cert chain, anything will do
, httpsOptions: require('localhost.daplie.com-certificates') , httpsOptions: require('localhost.daplie.com-certificates')

View File

@ -73,4 +73,10 @@ module.exports.init = function (deps) {
http.createServer(acmeResponder).listen(80, function () { http.createServer(acmeResponder).listen(80, function () {
console.log('Listening http on', this.address()); console.log('Listening http on', this.address());
}); });
return function () {
// Note: we should just keep a handle on
// the servers and close them each with server.close()
process.exit(1);
};
}; };