aboutsummaryrefslogtreecommitdiff
path: root/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'index.js')
-rw-r--r--index.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/index.js b/index.js
index 78c9a11..7c54827 100644
--- a/index.js
+++ b/index.js
@@ -25,9 +25,21 @@
// noinspection JSUnresolvedVariable,HttpUrlsUsage
+// Imports and stuff
const express = require('express');
+const fs = require('fs');
const app = express();
+// Restart manager
+async function restartManager() {
+ if (fs.existsSync("./RESTART")) {
+ fs.rmSync("./RESTART", { recursive: true });
+ console.log("Restart requested.");
+ process.exit(14);
+ }
+}
+setInterval(restartManager, 500)
+
// Public pages
app.get('/', (req, res) => {
res.render("index");