Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const https = require('https')
- const express = require('express')
- const selfsigned = require('selfsigned')
- const app = express()
- app.get('/', (req, res) => res.send('hello'))
- const attrs = [{name: 'commonName', value: 'example.com'}]
- const pems = selfsigned.generate(attrs, {days: 365})
- https.createServer({key: pems.private, cert: pems.cert}, app).listen(5001)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement