
const config = require('./../config.js');

module.exports = {
    header: function(title, cssFiles, moreHeader) {
        var res = `<html><head><title>${title}</title><link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet" />`;
        (cssFiles || []).forEach(function(i) {
            res += '<link href="' +config.rootUrl +i +'" rel="stylesheet"/>';
        });
        (moreHeader || []).forEach(function(i) {
            res += '<link href="favicon_err.png" type="image/png" rel="icon" id="linkFavicon" />';
        });
        return res +`</head><body>`;
    }
    ,footer: function(jsFiles, rawJs) {
        var res = "";
        (jsFiles || []).forEach(function(i) {
            res += '<script src="' +config.rootUrl +i +'"></script>';
        });
        if (rawJs) {
            res += '<script>' +rawJs +'</script>';
        }
        return res +`</body></html>`;
    }
};

