module.exports = function (app, jsonConfigGlobal, metaGlobals) {
    const fs = require("fs");
    const Eta = require("eta");
    app.use(function (req, res, next) {
        if(jsonConfigGlobal.maint){
            const data = fs.readFileSync("templates/error/maint.eta", "utf8");
            res.send(
                Eta.render(data, {
                  desc: metaGlobals.desc,
                  siteTitel: metaGlobals.titlePrefx + "Maintanance work",
                  debug: {},
                  fontawesomeKey: jsonConfigGlobal.fontAwesome
                })
              );
        }else{
            next()
        }
    });
}