So I have just turned my HTTP web application to HTTPS.
So my server.js currently looks like
const https = require('https');
const fs = require('fs');
const options = {
key: fs.readFileSync('key.pem'),
cert: fs.readFileSync('cert.pem')
};
https.createServer(options, function (req, res) {
res.writeHead(200);
res.end("hello world\n");
}).listen(8080);
This is a marko js project and my server.js used to look like
require("./project").server({
httpPort: process.env.PORT || 8080 // Optional, but added here for demo purposes
});
Now currently when I navigate to any of the various web pages I have created such as localhost:8080/home I am only returned hello world. I assume this is due to the response I have in my create server method.
How do I go about returning my web pages as intended or would there be any resources that could point me in the right direction?