Compare commits
1 Commits
0.0.1-alph
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| e1a1bdfd8f |
@ -1,5 +1,11 @@
|
|||||||
{
|
{
|
||||||
"web": {
|
"web": {
|
||||||
"port": 8535
|
"port": 8535
|
||||||
|
},
|
||||||
|
"launcher": {
|
||||||
|
"whitelist": [
|
||||||
|
|
||||||
|
],
|
||||||
|
"timestamp": "1746986400000"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
27
routes/api/v1/countdown.js
Normal file
27
routes/api/v1/countdown.js
Normal file
@ -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
|
||||||
Loading…
x
Reference in New Issue
Block a user