add something calone too lazy to add
This commit is contained in:
parent
06900ea5c0
commit
9c640be545
11
src/index.js
11
src/index.js
|
|
@ -14,6 +14,17 @@ setInterval(() => {
|
||||||
})
|
})
|
||||||
}, 15000)
|
}, 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/start", require("./routes/game/start.js"))
|
||||||
app.use("/game/stop", require("./routes/game/stop.js"))
|
app.use("/game/stop", require("./routes/game/stop.js"))
|
||||||
app.use("/game/running", require("./routes/game/running.js"))
|
app.use("/game/running", require("./routes/game/running.js"))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue