Skip to content

Instantly share code, notes, and snippets.



Last active Jun 19, 2020
What would you like to do?
const https = require("https");
const fs = require('fs');
const path = require("path");
const express = require("express");
const https_options ={
key : fs.readFileSync('./certkeys/cert_server.key'),
cert : fs.readFileSync('./certkeys/cert_server.crt')
const app = express();
app.use(express.static("public")); // Put your index.html into public folder
const port =8080;
const webServer = https.createServer(https_options,app);
webServer.listen(port, () => {
console.log("listening on https://localhost:" + port);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.