Last active
June 19, 2020 01:29
-
-
Save flushpot1125/12e4cf873c6231077053325aaa65d5cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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