How to use prerender - 10 common examples

To help you get started, we’ve selected a few prerender examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github HW-Core / universal-pwa / apps / server / server.js View on Github external
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));

    //Serving the files on the dist folder
    //app.use(config.basePath, express.static(DIST_DIR));
github HW-Core / universal-pwa / apps / server / server.js View on Github external
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));

    //Serving the files on the dist folder
    //app.use(config.basePath, express.static(DIST_DIR));
github HW-Core / universal-pwa / apps / server / server.js View on Github external
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));
github tooleks / photo-blog / prerender / server.js View on Github external
"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();
github tooleks / photo-blog / prerender / server.js View on Github external
"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();
github tooleks / photo-blog / prerender / server.js View on Github external
"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();
github ACGN-stock / acgn-stock / server / startup / prerenderServer.js View on Github external
Meteor.startup(() => {
  if (! Meteor.settings.public.production) {
    return;
  }

  const prerenderServer = prerender({
    port: Meteor.settings.public.prerenderServer.port,
    waitAfterLastRequest: 3000
  });
  prerenderServer.start();
  process.env.DISABLE_LOGGING = true;
});

prerender

Service to prerender Javascript rendered pages for SEO

MIT
Latest version published 2 months ago

Package Health Score

84 / 100
Full package analysis