diff --git a/server/frontend/connect-router.js b/server/frontend/connect-router.js index e72597c..be83043 100644 --- a/server/frontend/connect-router.js +++ b/server/frontend/connect-router.js @@ -5,31 +5,31 @@ module.exports = function (req, res) { if (req.query.encrypted === undefined || req.query.server === undefined) return res.status(400).send(` -
-unuse required params
- + +unuse required params
+ `); res.send(` - -Javascript is required for the site to work, enable it in your browser settings
-Javascript is required for the site to work, enable it in your browser settings
+404: Not finded.
")); +router.get("/*", (req, res) => + res.status(404).send("404: Not finded.
"), +); module.exports = router; diff --git a/server/frontend/index.js b/server/frontend/index.js index 5d2563b..f1edf35 100644 --- a/server/frontend/index.js +++ b/server/frontend/index.js @@ -7,48 +7,51 @@ const connectArea = require("./connect-router"); const api = require("./web-api/api-router"); module.exports = (address, port) => { - const app = express(); - logger.log("Static in", path.join(__dirname, "public")); - + const app = express(); + logger.log("Static in", path.join(__dirname, "public")); + app.use((req, res, next) => { // logger.log("HTTP headers:", req.headers); + if (global.server.isLocked) { + res.set("Content-Type", "plain/text"); + return res.send("Server temporary on reload"); + } next(); }); - - app.use(express.static(path.join(__dirname, "public"))); - app.use("/fl_dir", flDir); - app.use("/api", api); - + app.use(express.static(path.join(__dirname, "public"))); + + app.use("/fl_dir", flDir); + app.use("/api", api); + app.get("/connect-area", connectArea); - - app.use("/*", (req, res) => { - res.send(` + + app.use("/*", (req, res) => { + res.send(` - -Javascript is required for the site to work, enable it in your browser settings
-Javascript is required for the site to work, enable it in your browser settings
+