Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
prerenderNode.crawlerUserAgents.push('googlebot');
prerenderNode.crawlerUserAgents.push('bingbot');
prerenderNode.crawlerUserAgents.push('yandex');
var prerender = require("prerender"); // commonJS syntax
var server = prerender({
port: config.prerender.port
});
process.env.CACHE_MAXSIZE = config.prerender.cache_maxpages;
process.env.CACHE_TTL = config.prerender.cache_ttl;
server.use(require('prerender-memory-cache'));
server.use(prerender.sendPrerenderHeader());
// server.use(prerender.blockResources());
server.use(prerender.removeScriptTags());
server.use(prerender.httpHeaders());
const prerenderServiceUrl = config.prerender.host + ":" + config.prerender.port;
console.log("prerenderServiceUrl: " + prerenderServiceUrl);
app.use(prerenderNode.set('prerenderServiceUrl', prerenderServiceUrl));
server.start();
}
app.use(compression());
app.use(await smExpress(config.basePath, sitemap));
"use strict";
const prerender = require("prerender");
const server = prerender({
chromeFlags: ["--no-sandbox", "--headless", "--disable-gpu", "--remote-debugging-port=9222", "--hide-scrollbars"],
});
server.use(prerender.sendPrerenderHeader());
server.use(prerender.removeScriptTags());
server.use(prerender.httpHeaders());
server.start();