Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
https://nodejs.org/api/https.html
const https = require('https');
const fs = require('fs');
const options = {
key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')
};
https.createServer(options, (req, res) => {
res.writeHead(200);
res.end('hello world\n');
}).listen(8000);
Opens the documentation , and there ... Oh gods, there is not an exemplary algorithm, there is a specific example!
const https = require('https');
const fs = require('fs');
const options = {
key: fs.readFileSync('path/to/keys/key.pem'),
cert: fs.readFileSync('path/to/keys/cert.pem')
};
https.createServer(options, (req, res) => {
res.writeHead(200);
res.end('hello world\n');
}).listen(443);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question