Skip to content

Commit

Permalink
[backend] Fix some issues
Browse files Browse the repository at this point in the history
  • Loading branch information
MananGandhi1810 committed Jan 12, 2025
1 parent 6b36560 commit 6b10693
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions backend/bin/www
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,7 @@ import { executeFromQueue } from "../execution-worker/execute.js";
var port = normalizePort(process.env.PORT || "3000");
app.set("port", port);

// Check if SSL certificates are present
if (
fs.existsSync(`./ssl/privkey.pem`) ||
fs.existsSync(`./ssl/fullchain.pem`)
) {
const options = {
key: fs.readFileSync(`./ssl/privkey.pem`),
cert: fs.readFileSync(`./ssl/fullchain.pem`),
};

console.log("SSL certificates found. Running in HTTPS mode.");
var server = https.createServer(options, app);
} else {
console.log("No SSL certificates found. Running in HTTP mode.");
var server = http.createServer(app);
}
var server = http.createServer(app);

try {
await onQueueMessage("execute", executeFromQueue);
Expand Down

0 comments on commit 6b10693

Please sign in to comment.