/
server.js
38 lines (32 loc) · 1.97 KB
/
server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
var cluster = require("cluster");
if (cluster.isMaster) {
cluster.fork();
cluster.on("exit", function (worker, code, signal) {
// This is responsible for restarting the server when it crashes.
cluster.fork();
});
}
if (cluster.isWorker) {
start();
}
function start() {
const officr_logo = `
,@@@
@@@@@@@ @@@@@@@* @@@@@@@
@@@@@@@@* @@@@@@@@@ #@,
@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@ @@@@@ @@@@@@@@ @@@@@ @@@@
@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@ @@@@@ @@@@@@@@@@@@@@ @@@@@@@@@@
@@@@@@ @@@@@@ @@@@@ @@@@@ @@@@@ @@@@@ @@@@@@
@@@@@( @@@@@ @@@@@ @@@@@ @@@@@ #@@@@@ @@@@@
@@@@@@ @@@@@@ @@@@@ @@@@@ @@@@@ @@@@@@. @@@@@ @@@@@
@@@@@@@@@@@. @@@@@ @@@@@ @@@@@ @@@@@@@@@@@@ @@@@@
`;
console.log("Welcome to officr.");
console.log(officr_logo);
require("./server/console"); // This script is responsible for the filename before any console.log output
console.log("Starting ws.js...");
require("./server/ws"); // This script is responsible for creating a websocket for communication with the front end.
console.log("Starting expired-remover.js...");
require("./server/expired-remover"); // This script is responsible for removing all expired sessions
console.log("Everything should be running now.");
}