1.0.0 • Published 1 month ago

bare-https v1.0.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
1 month ago

bare-https

HTTPS library for JavaScript.

npm i bare-https

Usage

const https = require('bare-https')

// Same API as Node.js

const options = {
  cert: fs.readFileSync('test/fixtures/cert.crt'),
  key: fs.readFileSync('test/fixtures/cert.key')
}

const server = https.createServer(options, function (req, res) {
  res.statusCode = 200
  res.setHeader('Content-Length', 10)
  res.write('hello world!')
  res.end()
})

server.listen(0, function () {
  console.log('server is bound on', server.address().port)
})

License

Apache-2.0

1.0.0

1 month ago