I've managed to create https server with node by using those commands from node.js application:
var http = require('http');
var https = require('https');
var fs = require('fs');
var httpsOptions = {
key: fs.readFileSync('path/to/server-key.pem'),
cert: fs.readFileSync('path/to/server-crt.pem')
};
var app = function (req, res) {
res.writeHead(200);
res.end("hello world\n");
}
http.createServer(app).listen(8888);
https.createServer(httpsOptions, app).listen(4433);
What I would like to do is make https server run from folder, something similiar like this, which is for http-server. So if I later add file inside https folder, file can easily be reached from https://localhost:4433/main.js
(main.js is just an example file). Is it possible to do it for https?