Skip to content

Instantly share code, notes, and snippets.

@techforum-repo
Created October 31, 2020 19:36
Show Gist options
  • Save techforum-repo/dd9d7e3b772646423a4917772366f712 to your computer and use it in GitHub Desktop.
Save techforum-repo/dd9d7e3b772646423a4917772366f712 to your computer and use it in GitHub Desktop.
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