Browse Source

preserve lts support

pull/126/head
butlerx 8 years ago
parent
commit
a9f1a16c4c
No known key found for this signature in database GPG Key ID: B37CA765BAA89170
  1. 28
      app.js

28
app.js

@ -70,16 +70,22 @@ tty.on('disconnect', () => {
console.log('disconnect');
});
async function loadSSL({ sslkey, sslcert }) {
try {
return sslkey && sslcert
? {
key: await fs.readFile(path.resolve(sslkey)),
cert: await fs.readFile(path.resolve(sslcert)),
}
: {};
} catch (err) {
console.err(err);
process.exit(1);
function loadSSL({ sslkey, sslcert }) {
return new Promise((resolve, reject) => {
if (sslkey && sslcert) {
const ssl = {};
fs
.readFile(path.resolve(sslkey))
.then(key => {
ssl.key = key;
})
.then(fs.readFile(path.resolve(sslcert)))
.then(cert => {
ssl.cert = cert;
})
.then(resolve(ssl))
.catch(reject);
}
resolve({});
});
}

Loading…
Cancel
Save