Skip to content

Instantly share code, notes, and snippets.

@flushpot1125
Last active June 19, 2020 01:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flushpot1125/12e4cf873c6231077053325aaa65d5cf to your computer and use it in GitHub Desktop.
Save flushpot1125/12e4cf873c6231077053325aaa65d5cf to your computer and use it in GitHub Desktop.
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