Created
December 19, 2016 22:40
-
-
Save JWally/7da9d2f61ae0127310571c88c0def31a 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 http = require("http"), | |
https = require("https"), | |
fs = require("fs"), | |
path = require("path"), | |
serveStatic = require("serve-static"); | |
// Serve up public/ftp folder | |
var serve = serveStatic(path_to = path.join(__dirname, "..")); | |
var options = { | |
key: fs.readFileSync('./key.pem'), | |
cert: fs.readFileSync('./cert.pem') | |
}; | |
// Create server | |
var server = https.createServer(options, function onRequest (req, res, nxt) { | |
serve(req, res, function(){ | |
res.end("200"); | |
}); | |
}) | |
// Listen | |
server.listen(443) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment