From e1a1bdfd8fddb5a039c426aa0d0ac089f0f2517b Mon Sep 17 00:00:00 2001 From: azures04 Date: Sat, 10 May 2025 18:47:38 +0200 Subject: [PATCH] sync --- config.json | 6 ++++++ routes/api/v1/countdown.js | 27 +++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 routes/api/v1/countdown.js diff --git a/config.json b/config.json index b9548e9..1b1ba94 100644 --- a/config.json +++ b/config.json @@ -1,5 +1,11 @@ { "web": { "port": 8535 + }, + "launcher": { + "whitelist": [ + + ], + "timestamp": "1746986400000" } } \ No newline at end of file diff --git a/routes/api/v1/countdown.js b/routes/api/v1/countdown.js new file mode 100644 index 0000000..800edeb --- /dev/null +++ b/routes/api/v1/countdown.js @@ -0,0 +1,27 @@ +const utils = require("../../../modules/utils") +const logger = require("../../../modules/logger") +const express = require("express") +const router = express() + +router.get(":uuid", (req, res) => { + const config = require("../../../config.json") + if (config.launcher.whitelist.includes(req.params.uuid)) { + res.status(200).json({ + success: true + }) + } + const currentTime = Date.now() + if (currentTime > config.launcher.timestamp) { + res.status(200).json({ + success: true, + message: "OK" + }) + } else { + res.status(401).json({ + success: false, + message: "Too early." + }) + } +}) + +module.exports = router \ No newline at end of file