function insertPageMarkupFromHooks(app, pages, markup) {

    var cached;

    app.use(function (req, res, next) {

        if (req.url === "/" || pages[req.url.slice(1)]) {
            res.writeHead(200, {"Content-Type": "text/html", "Content-Encoding": "gzip"});
            if (!cached) {
                var buf = Buffer.from(markup, "utf-8");
                zlib.gzip(buf, function (_, result) {
                    cached = result;
                    res.end(result);
                });
            } else {
                res.end(cached);
            }
        } else {
            next();
        }
    });
}
@param app
@param pages
@param markup