const fs = require('fs');
const https = require('https');
const app = require('express')();
app.get('*', (req, res) => res.send('<h1>Hello, World</h1>'));
const server = https.createServer({
key: fs.readFileSync(`${__dirname}/localhost-key.pem`, 'utf8'),
cert: fs.readFileSync(`${__dirname}/localhost.pem`, 'utf8')
}, app);
await server.listen(443);
var express = require("express");
var fs = require("fs");
var https = require("https");
var app = express();
app.get("/", function (req, res) {
res.send("hello world");
});
https
.createServer(
{
key: fs.readFileSync("server.key"),
cert: fs.readFileSync("server.cert"),
},
app
)
.listen(3000, function () {
console.log(
"Example app listening on port 3000! Go to https://localhost:3000/"
);
});