Voting separated.

This commit is contained in:
Fergal Moran
2022-10-01 21:15:04 +01:00
parent 37aeabc23e
commit 0d9132dc51
21 changed files with 420 additions and 84 deletions

22
server.js Normal file
View File

@@ -0,0 +1,22 @@
var https = require("https");
var fs = require("fs");
const next = require("next");
const port = 3000;
const dev = process.env.NODE_ENV !== "production";
const app = next({ dev, dir: __dirname });
const handle = app.getRequestHandler();
var options = {
key: fs.readFileSync("/etc/letsencrypt/live/fergl.ie/privkey.pem"),
cert: fs.readFileSync("/etc/letsencrypt/live/fergl.ie/cert.pem"),
};
app.prepare().then(() => {
https
.createServer(options, (req, res) => handle(req, res))
.listen(port, (err) => {
if (err) throw err;
console.log(`> Ready on localhost:${port}`);
});
});