add something calone too lazy to add

This commit is contained in:
stan 2023-02-18 23:27:35 -06:00
parent 06900ea5c0
commit 9c640be545
1 changed files with 11 additions and 0 deletions

View File

@ -14,6 +14,17 @@ setInterval(() => {
})
}, 15000)
const validateQueryParam = (req, res, next) => {
const myQueryParam = process.env.accessKey;
if (req.query.hasOwnProperty(myQueryParam)) {
next();
} else {
res.status(400).send(`The ${myQueryParam} query parameter is missing`);
}
}
app.use(validateQueryParam);
app.use("/game/start", require("./routes/game/start.js"))
app.use("/game/stop", require("./routes/game/stop.js"))
app.use("/game/running", require("./routes/game/running.js"))