17 lines
441 B
JavaScript
17 lines
441 B
JavaScript
const express = require('express');
|
|
const app = express();
|
|
const PORT = 6000;
|
|
|
|
const PASS = "hi";
|
|
let gameActive = "yes"; // Change to "no" to lock the game
|
|
|
|
app.get('/check', (req, res) => {
|
|
if (req.headers['x-password'] === PASS) {
|
|
res.json({ run: gameActive });
|
|
} else {
|
|
res.status(401).json({ error: "Invalid Credentials" });
|
|
}
|
|
});
|
|
|
|
app.listen(PORT, () => console.log(`Game Server active on port ${PORT}`));
|