Created
October 31, 2020 19:36
-
-
Save techforum-repo/dd9d7e3b772646423a4917772366f712 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
var express = require('express') | |
const path = require('path') | |
const https = require('https'); | |
const fs = require('fs'); | |
var app = express() | |
app.get('/index.html', function (req, res) { | |
res.sendFile('index.html', { | |
root: path.join(__dirname, '.') | |
}) | |
}) | |
https.createServer({ | |
key: fs.readFileSync('ssl\\server.key'), | |
cert: fs.readFileSync('ssl\\server.crt') | |
}, app) | |
.listen(443, function () { | |
console.log('Example app listening on port 443! Go to https://localhost/') | |
}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment