Skip to content

Commit

Permalink
chore(examples/with-https): using destructuring
Browse files Browse the repository at this point in the history
  • Loading branch information
noahlaux authored and timneutkens committed Sep 14, 2018
1 parent 94fd6e5 commit 62c1e01
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions examples/with-https/index.js
@@ -1,15 +1,11 @@
const https = require('https');
const {run, send} = require('micro');

const cert = require('openssl-self-signed-certificate');
const {key, cert, passphrase} = require('openssl-self-signed-certificate');

const PORT = process.env.PORT || 3443;

const options = {
key: cert.key,
cert: cert.cert,
passphrase: cert.passphrase
};
const options = {key, cert, passphrase};

const microHttps = fn => https.createServer(options, (req, res) => run(req, res, fn));

Expand Down

0 comments on commit 62c1e01

Please sign in to comment.