Skip to content

Instantly share code, notes, and snippets.

@WasimAhmad
Forked from techforum-repo/app.js
Created February 14, 2022 16:46
Show Gist options
  • Save WasimAhmad/28ccba5cbbf59e4bb4058f6610efceb1 to your computer and use it in GitHub Desktop.
Save WasimAhmad/28ccba5cbbf59e4bb4058f6610efceb1 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