mirror of
https://github.com/Lomanic/presence-button-web
synced 2024-11-22 21:47:29 +00:00
🕵✨ Checkpoint
./server.js:933874/5595
This commit is contained in:
parent
7721c072ad
commit
840560b793
16
server.js
16
server.js
@ -1,4 +1,13 @@
|
|||||||
var fuzIsOpen = false;
|
var fuzIsOpen = false;
|
||||||
|
var lastSeen = new Date("1970-01-01");
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
const db = "./.data/data.json";
|
||||||
|
|
||||||
|
try {
|
||||||
|
var content = fs.readFileSync(db, "utf8");
|
||||||
|
fuzIsOpen = JSON.parse(content)[""]
|
||||||
|
} catch (err) {}
|
||||||
|
|
||||||
const express = require("express");
|
const express = require("express");
|
||||||
const app = express();
|
const app = express();
|
||||||
@ -14,6 +23,8 @@ app.get("/", (req, res) => {
|
|||||||
// http://expressjs.com/en/starter/basic-routing.html
|
// http://expressjs.com/en/starter/basic-routing.html
|
||||||
app.get("/img", (req, res) => {
|
app.get("/img", (req, res) => {
|
||||||
res.sendFile(__dirname + "/views/index.html");
|
res.sendFile(__dirname + "/views/index.html");
|
||||||
|
if (fuzIsOpen) {
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// http://expressjs.com/en/starter/basic-routing.html
|
// http://expressjs.com/en/starter/basic-routing.html
|
||||||
@ -33,5 +44,8 @@ const listener = app.listen(process.env.PORT, function() {
|
|||||||
|
|
||||||
process.on("SIGTERM", function() {
|
process.on("SIGTERM", function() {
|
||||||
console.log("SIGTERM received, sending SOS to Resurrect...");
|
console.log("SIGTERM received, sending SOS to Resurrect...");
|
||||||
require('https').get("https://resurrect.glitch.me/"+process.env.PROJECT_DOMAIN+"", process.exit)
|
require("https").get(
|
||||||
|
"https://resurrect.glitch.me/" + process.env.PROJECT_DOMAIN + "",
|
||||||
|
process.exit
|
||||||
|
);
|
||||||
});
|
});
|
Loading…
Reference in New Issue
Block a user