Proper auth added

This commit is contained in:
Fergal Moran
2023-01-24 01:28:15 +00:00
parent 886c207f1e
commit 6f12075101
80 changed files with 150416 additions and 1895 deletions

23
server.js Normal file
View File

@@ -0,0 +1,23 @@
const https = require("https");
const fs = require("fs");
const next = require("next");
const port = 3000;
const dev = process.env.NODE_ENV !== "production";
const hostname = "nukeitter.dev.fergl.ie";
const app = next({ dev, hostname, port, dir: __dirname });
const handle = app.getRequestHandler();
const options = {
key: fs.readFileSync("/etc/letsencrypt/live/dev.fergl.ie/privkey.pem"),
cert: fs.readFileSync("/etc/letsencrypt/live/dev.fergl.ie/fullchain.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}`);
});
});