fix: no https at server level
Node.js CI / CI (push) Failing after 12s
Security Scan and Upload / Security & DefectDojo Upload (push) Successful in 1m24s

nginx does it
This commit is contained in:
2026-01-08 21:03:19 -08:00
parent 15ee3d163f
commit 665eb5b3aa
-29
View File
@@ -1,6 +1,4 @@
import { readFile } from "fs/promises";
import http from "http"; import http from "http";
import https from "https";
import express from "express"; import express from "express";
@@ -62,31 +60,4 @@ export const serve = async (bot: ExtendedClient) => {
httpServer.listen(10080, async () => { httpServer.listen(10080, async () => {
await bot.debug.send("http server listening on port 10080"); await bot.debug.send("http server listening on port 10080");
}); });
if (process.env.NODE_ENV === "production") {
const privateKey = await readFile(
"/etc/letsencrypt/live/afp.nhcarrigan.com/privkey.pem",
"utf8"
);
const certificate = await readFile(
"/etc/letsencrypt/live/afp.nhcarrigan.com/cert.pem",
"utf8"
);
const ca = await readFile(
"/etc/letsencrypt/live/afp.nhcarrigan.com/chain.pem",
"utf8"
);
const credentials = {
key: privateKey,
cert: certificate,
ca: ca,
};
const httpsServer = https.createServer(credentials, app);
httpsServer.listen(10443, async () => {
await bot.debug.send("https server listening on port 10443");
});
}
}; };